max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
bvs/background_verification/report/checks_status_report/checks_status_report.py
vhrspvl/vhrs-bvs
1
3400
# Copyright (c) 2013, VHRS and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _, msgprint from frappe.utils import (cint, cstr, date_diff, flt, getdate, money_in_words, nowdate, rounded, today) from datet...
# Copyright (c) 2013, VHRS and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _, msgprint from frappe.utils import (cint, cstr, date_diff, flt, getdate, money_in_words, nowdate, rounded, today) from datet...
en
0.616686
# Copyright (c) 2013, VHRS and contributors # For license information, please see license.txt select app.checks_group,app.customer,app.ref_id,app.candidate_name,app.in_date,app.status from `tabApplicant` app where app.in_date between %(start_date)s and %(end_date)s order by app.in_date
2.094691
2
dataset/dataset.py
TeamOfProfGuo/few_shot_baseline
0
3401
<filename>dataset/dataset.py import os DEFAULT_ROOT = './materials' datasets_dt = {} def register(name): def decorator(cls): datasets_dt[name] = cls return cls return decorator def make(name, **kwargs): if kwargs.get('root_path') is None: kwargs['root_path'] = os.path.join(DEFA...
<filename>dataset/dataset.py import os DEFAULT_ROOT = './materials' datasets_dt = {} def register(name): def decorator(cls): datasets_dt[name] = cls return cls return decorator def make(name, **kwargs): if kwargs.get('root_path') is None: kwargs['root_path'] = os.path.join(DEFA...
none
1
2.516309
3
src/proto_formatter/syntax_parser.py
YiXiaoCuoHuaiFenZi/proto-formatter
0
3402
from .comment import CommentParser from .protobuf import Protobuf from .proto_structures import Syntax class SyntaxParser(): @classmethod def parse_and_add(cls, proto_obj: Protobuf, line, top_comment_list): if proto_obj.syntax is not None: raise 'multiple syntax detected!' proto_...
from .comment import CommentParser from .protobuf import Protobuf from .proto_structures import Syntax class SyntaxParser(): @classmethod def parse_and_add(cls, proto_obj: Protobuf, line, top_comment_list): if proto_obj.syntax is not None: raise 'multiple syntax detected!' proto_...
none
1
2.633097
3
IPL/app/core/views.py
mgp-git/Flask
0
3403
<reponame>mgp-git/Flask<filename>IPL/app/core/views.py from flask import render_template, request, Blueprint core = Blueprint('core', __name__) @core.route("/", methods=['GET', 'POST']) def home(): return render_template('home.html') @core.route("/about") def about(): return render_template('about.html') ...
from flask import render_template, request, Blueprint core = Blueprint('core', __name__) @core.route("/", methods=['GET', 'POST']) def home(): return render_template('home.html') @core.route("/about") def about(): return render_template('about.html') @core.route('/search', methods=['GET', 'POST']) def se...
none
1
2.338773
2
tests/test_s3.py
tdilauro/circulation-core
1
3404
<reponame>tdilauro/circulation-core # encoding: utf-8 import functools import os from urllib.parse import urlsplit import boto3 import botocore import pytest from botocore.exceptions import BotoCoreError, ClientError from mock import MagicMock from parameterized import parameterized from ..mirror import MirrorUploade...
# encoding: utf-8 import functools import os from urllib.parse import urlsplit import boto3 import botocore import pytest from botocore.exceptions import BotoCoreError, ClientError from mock import MagicMock from parameterized import parameterized from ..mirror import MirrorUploader from ..model import ( DataSour...
en
0.790815
# encoding: utf-8 Create and configure a simple S3 integration. Adds a value to settings dictionary :param settings: Settings dictionary :type settings: Dict :param key: Key :type key: string :param value: Value :type value: Any :return: Updated settings dicti...
1.983991
2
lbry/scripts/set_build.py
vanshdevgan/lbry-sdk
0
3405
"""Set the build version to be 'qa', 'rc', 'release'""" import sys import os import re import logging log = logging.getLogger() log.addHandler(logging.StreamHandler()) log.setLevel(logging.DEBUG) def get_build_type(travis_tag=None): if not travis_tag: return "qa" log.debug("getting build type for ta...
"""Set the build version to be 'qa', 'rc', 'release'""" import sys import os import re import logging log = logging.getLogger() log.addHandler(logging.StreamHandler()) log.setLevel(logging.DEBUG) def get_build_type(travis_tag=None): if not travis_tag: return "qa" log.debug("getting build type for ta...
en
0.479678
Set the build version to be 'qa', 'rc', 'release'
2.235406
2
backend/jenkins/pipelines/ansible/utils/testplan_gen.py
gbl1124/hfrd
5
3406
<gh_stars>1-10 #!/usr/bin/python import yaml import os import ast import sys from collections import OrderedDict curr_dir = os.getcwd() work_dir = sys.argv[1] network_type = sys.argv[2] testplan_dict = {} testplan_dict["name"] = "System performance test" testplan_dict["description"] = "This test is to create as muc...
#!/usr/bin/python import yaml import os import ast import sys from collections import OrderedDict curr_dir = os.getcwd() work_dir = sys.argv[1] network_type = sys.argv[2] testplan_dict = {} testplan_dict["name"] = "System performance test" testplan_dict["description"] = "This test is to create as much chaincode comp...
en
0.591879
#!/usr/bin/python # Load template file # channel_join = template["CHANNEL_JOIN"] # Load connection profile # When there is only peer or orderer, we skip tests. # CREATE_CHANNEL # JOIN_CHANNEL and INSTALL_CHAINCODE # CHAINCODE_INSTALL # CHAINCODE_INSTANTIATE # CHAINCODE_INVOKE # Invoke with fixed transaction count : 100...
2.026919
2
dblib/test_lib.py
cyber-fighters/dblib
0
3407
"""Collection of tests.""" import pytest import dblib.lib f0 = dblib.lib.Finding('CD spook', 'my_PC', 'The CD drive is missing.') f1 = dblib.lib.Finding('Unplugged', 'my_PC', 'The power cord is unplugged.') f2 = dblib.lib.Finding('Monitor switched off', 'my_PC', 'The monitor is switched off.') def test_add_remove(...
"""Collection of tests.""" import pytest import dblib.lib f0 = dblib.lib.Finding('CD spook', 'my_PC', 'The CD drive is missing.') f1 = dblib.lib.Finding('Unplugged', 'my_PC', 'The power cord is unplugged.') f2 = dblib.lib.Finding('Monitor switched off', 'my_PC', 'The monitor is switched off.') def test_add_remove(...
en
0.656352
Collection of tests. Test function. # regular cases # test exceptions Test function.
2.778782
3
src/azure-cli/azure/cli/command_modules/policyinsights/_completers.py
YuanyuanNi/azure-cli
3,287
3408
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
en
0.389323
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
1.828756
2
hordak/migrations/0011_auto_20170225_2222.py
CodeBrew-LTD/django-hordak
187
3409
<reponame>CodeBrew-LTD/django-hordak # -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-02-25 22:22 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import django_smalluuid.models class Migration(migrations.Migrat...
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-02-25 22:22 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import django_smalluuid.models class Migration(migrations.Migration): dependencies = [("hordak",...
en
0.775666
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-02-25 22:22
1.824246
2
Bot Telegram.py
devilnotcry77/devil_not_cry
0
3410
from aiogram import Bot, types from aiogram.dispatcher import Dispatcher from aiogram.utils import executor TOKEN = "Token for you bot" bot = Bot(token=TOKEN) dp = Dispatcher(bot) @dp.message_handler(command=['start', 'help']) async def send_welcome(msg: types.Message): await msg.reply_to_message(f'Добро ...
from aiogram import Bot, types from aiogram.dispatcher import Dispatcher from aiogram.utils import executor TOKEN = "Token for you bot" bot = Bot(token=TOKEN) dp = Dispatcher(bot) @dp.message_handler(command=['start', 'help']) async def send_welcome(msg: types.Message): await msg.reply_to_message(f'Добро ...
none
1
2.557197
3
redactor/utils.py
danlgz/django-wysiwyg-redactor
0
3411
<reponame>danlgz/django-wysiwyg-redactor<filename>redactor/utils.py from django.core.exceptions import ImproperlyConfigured from importlib import import_module try: from django.utils.encoding import force_text except ImportError: from django.utils.encoding import force_unicode as force_text from django.utils.f...
from django.core.exceptions import ImproperlyConfigured from importlib import import_module try: from django.utils.encoding import force_text except ImportError: from django.utils.encoding import force_unicode as force_text from django.utils.functional import Promise import json def import_class(path): ...
none
1
2.214608
2
timedpid.py
DrGFreeman/PyTools
1
3412
# timedpid.py # Source: https://github.com/DrGFreeman/PyTools # # MIT License # # Copyright (c) 2017 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, in...
# timedpid.py # Source: https://github.com/DrGFreeman/PyTools # # MIT License # # Copyright (c) 2017 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, in...
en
0.800917
# timedpid.py # Source: https://github.com/DrGFreeman/PyTools # # MIT License # # Copyright (c) 2017 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, in...
2.071158
2
pmon/zmq_responder.py
bernd-clemenz/pmon
1
3413
# # -*- coding: utf-8-*- # receives messages via zmq and executes some simple # operations. # # (c) ISC Clemenz & Weinbrecht GmbH 2018 # import json import requests import zmq import pmon class ZmqResponder(object): context = None socket = None def __init__(self): """ Constructor. ...
# # -*- coding: utf-8-*- # receives messages via zmq and executes some simple # operations. # # (c) ISC Clemenz & Weinbrecht GmbH 2018 # import json import requests import zmq import pmon class ZmqResponder(object): context = None socket = None def __init__(self): """ Constructor. ...
en
0.629923
# # -*- coding: utf-8-*- # receives messages via zmq and executes some simple # operations. # # (c) ISC Clemenz & Weinbrecht GmbH 2018 # Constructor. Send a message to Slack Web-Hook. :param message: the message record to be send to slack :return: None
2.4429
2
test/test_substitute.py
sanskrit/padmini
1
3414
<filename>test/test_substitute.py from padmini import operations as op def test_yatha(): before = ("tAs", "Tas", "Ta", "mip") after = ("tAm", "tam", "ta", "am") for i, b in enumerate(before): assert op.yatha(b, before, after) == after[i] """ def test_ti(): assert S.ti("ta", "e") == "te" ...
<filename>test/test_substitute.py from padmini import operations as op def test_yatha(): before = ("tAs", "Tas", "Ta", "mip") after = ("tAm", "tam", "ta", "am") for i, b in enumerate(before): assert op.yatha(b, before, after) == after[i] """ def test_ti(): assert S.ti("ta", "e") == "te" ...
en
0.294073
def test_ti(): assert S.ti("ta", "e") == "te" assert S.ti("AtAm", "e") == "Ate" def test_antya(): assert S.antya("ti", "u") == "tu" assert S.antya("te", "Am") == "tAm"
3.04918
3
TVSaffiliations/extractemails_nogui.py
kmhambleton/LSST-TVSSC.github.io
0
3415
# coding: utf-8 #just prints the emails of members of a group to stdout, #both primary and secondary members # run as # $python extractemails_nogui.py "Tidal Disruption Events" from __future__ import print_function '__author__' == '<NAME>, NYU - GitHub: fedhere' import sys import pandas as pd from argparse import Argu...
# coding: utf-8 #just prints the emails of members of a group to stdout, #both primary and secondary members # run as # $python extractemails_nogui.py "Tidal Disruption Events" from __future__ import print_function '__author__' == '<NAME>, NYU - GitHub: fedhere' import sys import pandas as pd from argparse import Argu...
en
0.817747
# coding: utf-8 #just prints the emails of members of a group to stdout, #both primary and secondary members # run as # $python extractemails_nogui.py "Tidal Disruption Events" Use ArgParser to build up the arguments we will use in our script # get the script name without the extension & use it to build up # the json f...
3.058609
3
cogs/owner.py
Obsidian-Development/JDBot
0
3416
<reponame>Obsidian-Development/JDBot<filename>cogs/owner.py from discord.ext import commands, menus import utils import random , discord, os, importlib, mystbin, typing, aioimgur, functools, tweepy import traceback, textwrap from discord.ext.menus.views import ViewMenuPages class Owner(commands.Cog): def __init__(se...
from discord.ext import commands, menus import utils import random , discord, os, importlib, mystbin, typing, aioimgur, functools, tweepy import traceback, textwrap from discord.ext.menus.views import ViewMenuPages class Owner(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(brief="a c...
en
0.823335
#I need to fix all cog_command_error #make sure to swap to autoconverter if it gets added.
2.444237
2
tests/input_files/full_sm_UFO/function_library.py
valassi/mg5amc_test
1
3417
<gh_stars>1-10 # This file is part of the UFO. # # This file contains definitions for functions that # are extensions of the cmath library, and correspond # either to functions that are in cmath, but inconvenient # to access from there (e.g. z.conjugate()), # or functions that are simply not defined. # # from __future...
# This file is part of the UFO. # # This file contains definitions for functions that # are extensions of the cmath library, and correspond # either to functions that are in cmath, but inconvenient # to access from there (e.g. z.conjugate()), # or functions that are simply not defined. # # from __future__ import absol...
en
0.898432
# This file is part of the UFO. # # This file contains definitions for functions that # are extensions of the cmath library, and correspond # either to functions that are in cmath, but inconvenient # to access from there (e.g. z.conjugate()), # or functions that are simply not defined. # # # # shortcuts for functions f...
2.113916
2
cli/polyaxon/managers/cli.py
hackerwins/polyaxon
0
3418
<gh_stars>0 #!/usr/bin/python # # Copyright 2019 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
#!/usr/bin/python # # Copyright 2019 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
en
0.787661
#!/usr/bin/python # # Copyright 2019 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
1.73448
2
duckql/properties/tests/test_null.py
fossabot/duckql-python
4
3419
import pytest from duckql.properties import Null @pytest.fixture(scope="module") def valid_instance() -> Null: return Null() def test_string(valid_instance: Null): assert str(valid_instance) == 'NULL' def test_obj(valid_instance: Null): assert valid_instance.obj == 'properties.Null' def test_json_p...
import pytest from duckql.properties import Null @pytest.fixture(scope="module") def valid_instance() -> Null: return Null() def test_string(valid_instance: Null): assert str(valid_instance) == 'NULL' def test_obj(valid_instance: Null): assert valid_instance.obj == 'properties.Null' def test_json_p...
none
1
2.485826
2
openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/lib/gobject-introspection/giscanner/codegen.py
sotaoverride/backup
0
3420
<gh_stars>0 # -*- Mode: Python -*- # GObject-Introspection - a framework for introspecting GObject libraries # Copyright (C) 2010 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foun...
# -*- Mode: Python -*- # GObject-Introspection - a framework for introspecting GObject libraries # Copyright (C) 2010 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; eith...
en
0.767904
# -*- Mode: Python -*- # GObject-Introspection - a framework for introspecting GObject libraries # Copyright (C) 2010 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; eith...
1.843237
2
nevergrad/parametrization/utils.py
mehrdad-shokri/nevergrad
2
3421
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import sys import shutil import tempfile import subprocess import typing as tp from pathlib import Path from ne...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import sys import shutil import tempfile import subprocess import typing as tp from pathlib import Path from ne...
en
0.871084
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. Provides access to a set of descriptors for the parametrization This can be used within optimizers. # TODO add repr # ...
2.286286
2
Section 20/2.Document-transfer_files.py
airbornum/-Complete-Python-Scripting-for-Automation
18
3422
<gh_stars>10-100 import paramiko ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname='172.16.58.3',username='ec2-user',password='<PASSWORD>',port=22) sftp_client=ssh.open_sftp() #sftp_client.get('/home/ec2-user/paramiko_download.txt','paramiko_downloaded_file...
import paramiko ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(hostname='172.16.58.3',username='ec2-user',password='<PASSWORD>',port=22) sftp_client=ssh.open_sftp() #sftp_client.get('/home/ec2-user/paramiko_download.txt','paramiko_downloaded_file.txt') #sftp_cli...
en
0.255264
#sftp_client.get('/home/ec2-user/paramiko_download.txt','paramiko_downloaded_file.txt') #sftp_client.chdir("/home/ec2-user") #print(sftp_client.getcwd()) #sftp_client.get('demo.txt','C:\\Users\\Automation\\Desktop\\download_file.txt')
2.369327
2
nimlime_core/utils/internal_tools.py
gmpreussner/Varriount.NimLime
0
3423
# coding=utf-8 """ Internal tools for NimLime development & testing. """ from pprint import pprint import sublime try: from cProfile import Profile except ImportError: from profile import Profile from functools import wraps from pstats import Stats try: from StringIO import StringIO except ImportError: ...
# coding=utf-8 """ Internal tools for NimLime development & testing. """ from pprint import pprint import sublime try: from cProfile import Profile except ImportError: from profile import Profile from functools import wraps from pstats import Stats try: from StringIO import StringIO except ImportError: ...
en
0.639702
# coding=utf-8 Internal tools for NimLime development & testing. # Debug printer Print when debugging. :type args: Any :type kwargs: Any # Profiling functions Decorator which profiles a single function. Call print_profile_data to print the collected data. :type func: Callable :rtype: Callable Print ...
1.970449
2
test/unit/test_monitor.py
dmvieira/driftage
4
3424
import orjson from asynctest import TestCase, Mock, patch from freezegun import freeze_time from driftage.monitor import Monitor class TestMonitor(TestCase): def setUp(self): self.monitor = Monitor( "user_test@local", "<PASSWORD>", "identif" ) def tearDown(self): self.mo...
import orjson from asynctest import TestCase, Mock, patch from freezegun import freeze_time from driftage.monitor import Monitor class TestMonitor(TestCase): def setUp(self): self.monitor = Monitor( "user_test@local", "<PASSWORD>", "identif" ) def tearDown(self): self.mo...
none
1
2.316775
2
examples/todo_advanced/main.py
travisluong/fastarg
1
3425
<filename>examples/todo_advanced/main.py import fastarg import commands.todo as todo import commands.user as user app = fastarg.Fastarg(description="productivity app", prog="todo") @app.command() def hello_world(name: str): """hello world""" print("hello " + name) app.add_fastarg(todo.app, name="todo") app.a...
<filename>examples/todo_advanced/main.py import fastarg import commands.todo as todo import commands.user as user app = fastarg.Fastarg(description="productivity app", prog="todo") @app.command() def hello_world(name: str): """hello world""" print("hello " + name) app.add_fastarg(todo.app, name="todo") app.a...
en
0.152096
hello world
2.532394
3
tests/test_channel.py
rwilhelm/aiormq
176
3426
import asyncio import uuid import pytest from aiomisc_pytest.pytest_plugin import TCPProxy import aiormq async def test_simple(amqp_channel: aiormq.Channel): await amqp_channel.basic_qos(prefetch_count=1) assert amqp_channel.number queue = asyncio.Queue() deaclare_ok = await amqp_channel.queue_dec...
import asyncio import uuid import pytest from aiomisc_pytest.pytest_plugin import TCPProxy import aiormq async def test_simple(amqp_channel: aiormq.Channel): await amqp_channel.basic_qos(prefetch_count=1) assert amqp_channel.number queue = asyncio.Queue() deaclare_ok = await amqp_channel.queue_dec...
en
0.660147
# type: DeliveredMessage # type: DeliveredMessage # type: aiormq.Channel # type: aiormq.Channel RabbitMQ has been observed to send confirmations in a strange pattern when publishing simultaneously where only some messages are delivered to a queue. It sends acks like this 1 2 4 5(multiple, confirming also 3). ...
2.058486
2
nitro-python/nssrc/com/citrix/netscaler/nitro/resource/stat/mediaclassification/__init__.py
culbertm/NSttyPython
2
3427
__all__ = ['mediaclassification_stats']
__all__ = ['mediaclassification_stats']
none
1
1.094166
1
balanced_parens.py
joeghodsi/interview-questions
1
3428
''' Problem description: Given a string, determine whether or not the parentheses are balanced ''' def balanced_parens(str): ''' runtime: O(n) space : O(1) ''' if str is None: return True open_count = 0 for char in str: if char == '(': open_count += 1 ...
''' Problem description: Given a string, determine whether or not the parentheses are balanced ''' def balanced_parens(str): ''' runtime: O(n) space : O(1) ''' if str is None: return True open_count = 0 for char in str: if char == '(': open_count += 1 ...
en
0.52969
Problem description: Given a string, determine whether or not the parentheses are balanced runtime: O(n) space : O(1)
3.963308
4
plaso/parsers/winreg_plugins/ccleaner.py
pyllyukko/plaso
1,253
3429
# -*- coding: utf-8 -*- """Parser for the CCleaner Registry key.""" import re from dfdatetime import time_elements as dfdatetime_time_elements from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions from plaso.parsers import winreg_parser from plaso.parsers.winr...
# -*- coding: utf-8 -*- """Parser for the CCleaner Registry key.""" import re from dfdatetime import time_elements as dfdatetime_time_elements from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions from plaso.parsers import winreg_parser from plaso.parsers.winr...
en
0.57934
# -*- coding: utf-8 -*- Parser for the CCleaner Registry key. CCleaner configuration event data. Attributes: configuration (str): CCleaner configuration. key_path (str): Windows Registry key path. Initializes event data. CCleaner update event data. Attributes: key_path (str): Windows Registry key path...
2.217267
2
pushpluck/base.py
ejconlon/pushpluck
0
3430
<reponame>ejconlon/pushpluck from abc import ABCMeta, abstractmethod from dataclasses import dataclass from typing import Any, TypeVar X = TypeVar('X') class Closeable(metaclass=ABCMeta): @abstractmethod def close(self) -> None: """ Close this to free resources and deny further use. """ rais...
from abc import ABCMeta, abstractmethod from dataclasses import dataclass from typing import Any, TypeVar X = TypeVar('X') class Closeable(metaclass=ABCMeta): @abstractmethod def close(self) -> None: """ Close this to free resources and deny further use. """ raise NotImplementedError() cla...
en
0.951478
Close this to free resources and deny further use. Reset this to a known good state for further use. None is the type with 1 inhabitant, None. Void is the type with 0 inhabitants. This allows you to trivially satisfy type checking by returning `void.absurd()` since it's impossible for `void` to exist in the fir...
3.438047
3
test/cuberead/highres/test_default_high_res.py
CAB-LAB/cube-performance-test
0
3431
import time import pytest from test import config from test.cube_utils import CubeUtils ITERATIONS_NUM = getattr(config, 'iterations_num', 1) ROUNDS_NUM = getattr(config, 'rounds_num', 10) class TestDefaultHighRes: @pytest.fixture(scope="class", autouse=True) def cube_default(self): cube_utils = Cu...
import time import pytest from test import config from test.cube_utils import CubeUtils ITERATIONS_NUM = getattr(config, 'iterations_num', 1) ROUNDS_NUM = getattr(config, 'rounds_num', 10) class TestDefaultHighRes: @pytest.fixture(scope="class", autouse=True) def cube_default(self): cube_utils = Cu...
en
0.361692
# --------------- # Read spatially # --------------- # --------------- # Read temporally # ---------------
1.979678
2
tests/components/test_dialogue_flow.py
dyoshiha/mindmeld
1
3432
import pytest from mindmeld.components import Conversation def assert_reply(directives, templates, *, start_index=0, slots=None): """Asserts that the provided directives contain the specified reply Args: directives (list[dict[str, dict]]): list of directives returned by application templates ...
import pytest from mindmeld.components import Conversation def assert_reply(directives, templates, *, start_index=0, slots=None): """Asserts that the provided directives contain the specified reply Args: directives (list[dict[str, dict]]): list of directives returned by application templates ...
en
0.918628
Asserts that the provided directives contain the specified reply Args: directives (list[dict[str, dict]]): list of directives returned by application templates (Union[str, Set[str]]): The reply must be a member of this set. start_index (int, optional): The index of the first client action a...
2.346951
2
mine/src/main/python/SVM.py
nextzlog/mine
3
3433
import os,sys import webbrowser import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.cm as cm import matplotlib.pylab as plt from matplotlib import ticker plt.rcParams['font.family'] = 'monospace' fig = plt.figure() rect = fig.add_subplot(111, aspect='equal') data0 = np.loadtxt('data0.dat', del...
import os,sys import webbrowser import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.cm as cm import matplotlib.pylab as plt from matplotlib import ticker plt.rcParams['font.family'] = 'monospace' fig = plt.figure() rect = fig.add_subplot(111, aspect='equal') data0 = np.loadtxt('data0.dat', del...
none
1
2.374357
2
sarna/report_generator/scores.py
rsrdesarrollo/sarna
25
3434
<gh_stars>10-100 from sarna.model.enums import Score, Language from sarna.report_generator import make_run from sarna.report_generator.locale_choice import locale_choice from sarna.report_generator.style import RenderStyle def score_to_docx(score: Score, style: RenderStyle, lang: Language): ret = make_run(getattr...
from sarna.model.enums import Score, Language from sarna.report_generator import make_run from sarna.report_generator.locale_choice import locale_choice from sarna.report_generator.style import RenderStyle def score_to_docx(score: Score, style: RenderStyle, lang: Language): ret = make_run(getattr(style, score.nam...
en
0.441979
# TODO: something
2.140254
2
tests/hwsim/test_ap_open.py
waittrue/wireless
1
3435
# Open mode AP tests # Copyright (c) 2014, Qualcomm Atheros, Inc. # # This software may be distributed under the terms of the BSD license. # See README for more details. import logging logger = logging.getLogger() import struct import subprocess import time import os import hostapd import hwsim_utils from tshark impo...
# Open mode AP tests # Copyright (c) 2014, Qualcomm Atheros, Inc. # # This software may be distributed under the terms of the BSD license. # See README for more details. import logging logger = logging.getLogger() import struct import subprocess import time import os import hostapd import hwsim_utils from tshark impo...
en
0.864937
# Open mode AP tests # Copyright (c) 2014, Qualcomm Atheros, Inc. # # This software may be distributed under the terms of the BSD license. # See README for more details. AP with open mode (no security) configuration AP with open mode configuration and large packet loss AP with open mode configuration and unknown Action...
2.270671
2
task_templates/pipelines/python3_pytorch_regression/model_utils.py
andreakropp/datarobot-user-models
0
3436
<reponame>andreakropp/datarobot-user-models #!/usr/bin/env python # coding: utf-8 # pylint: disable-all from __future__ import absolute_import from sklearn.preprocessing import LabelEncoder from pathlib import Path import torch from torch.autograd import Variable import torch.nn as nn import torch.optim as optim cl...
#!/usr/bin/env python # coding: utf-8 # pylint: disable-all from __future__ import absolute_import from sklearn.preprocessing import LabelEncoder from pathlib import Path import torch from torch.autograd import Variable import torch.nn as nn import torch.optim as optim class BinModel(nn.Module): expected_target...
en
0.814558
#!/usr/bin/env python # coding: utf-8 # pylint: disable-all # y_hat will be (batch_size, 1) dim, so coerce target to look the same # (1) Forward # (2) Compute diff # (3) Compute gradients # (4) update weights # exclude any completely-missing columns when checking for numerics # keep numeric features, zero-impute any mi...
2.749767
3
py/surveysim/weather.py
mlandriau/surveysim
0
3437
<reponame>mlandriau/surveysim """Simulate stochastic observing weather conditions. The simulated conditions include seeing, transparency and the dome-open fraction. """ from __future__ import print_function, division, absolute_import from datetime import datetime import numpy as np import astropy.time import astrop...
"""Simulate stochastic observing weather conditions. The simulated conditions include seeing, transparency and the dome-open fraction. """ from __future__ import print_function, division, absolute_import from datetime import datetime import numpy as np import astropy.time import astropy.table import astropy.units a...
en
0.870186
Simulate stochastic observing weather conditions. The simulated conditions include seeing, transparency and the dome-open fraction. Simulate weather conditions affecting observations. The start/stop date range is taken from the survey config. Seeing and transparency values are stored with 32-bit floats to sa...
2.899103
3
lib/csv_writer.py
takeratta/ga-dev-tools
2
3438
# coding=utf-8 # Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
# coding=utf-8 # Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
en
0.846579
# coding=utf-8 # Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
2.904877
3
resdata/TensorFlow/RNN_Prediction/stockPrediction202005201318.py
yuwenxianglong/zhxsh.github.io
0
3439
<gh_stars>0 # -*- coding: utf-8 -*- """ @Project : RNN_Prediction @Author : <NAME> @Filename: stockPrediction202005201318.py @IDE : PyCharm @Time1 : 2020-05-20 13:18:46 @Time2 : 2020/5/20 13:18 @Month1 : 5月 @Month2 : 五月 """ import tushare as ts import tensorflow as tf import pandas as pd from sklearn.model_...
# -*- coding: utf-8 -*- """ @Project : RNN_Prediction @Author : <NAME> @Filename: stockPrediction202005201318.py @IDE : PyCharm @Time1 : 2020-05-20 13:18:46 @Time2 : 2020/5/20 13:18 @Month1 : 5月 @Month2 : 五月 """ import tushare as ts import tensorflow as tf import pandas as pd from sklearn.model_selection im...
en
0.473059
# -*- coding: utf-8 -*- @Project : RNN_Prediction @Author : <NAME> @Filename: stockPrediction202005201318.py @IDE : PyCharm @Time1 : 2020-05-20 13:18:46 @Time2 : 2020/5/20 13:18 @Month1 : 5月 @Month2 : 五月 # train, val = train_test_split(stock_catl, test_size=0.5) # train = train.sort_index(ascending=True) # v...
2.744863
3
src/mushme.py
MuShMe/MuShMe
1
3440
<filename>src/mushme.py<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- from src import app import os import shutil from flask import Flask, render_template, session, request, flash, url_for, redirect from Forms import ContactForm, LoginForm, editForm, ReportForm, CommentForm, searchForm, AddPlaylist from f...
<filename>src/mushme.py<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- from src import app import os import shutil from flask import Flask, render_template, session, request, flash, url_for, redirect from Forms import ContactForm, LoginForm, editForm, ReportForm, CommentForm, searchForm, AddPlaylist from f...
en
0.588638
#!/usr/bin/env python # -*- coding: utf-8 -*- #For the collector script. #For the songs #For the playlist #for the admin pages #for the artist pages #For database connections. SELECT User_id from MuShMe.entries WHERE Email_id="%s" AND Pwdhash="%s" UPDATE MuShMe.entries SET Last_Login=CURRENT_TIMESTAMP() WHERE User_id="...
1.91766
2
language/labs/drkit/evaluate.py
Xtuden-com/language
1,199
3441
<gh_stars>1000+ # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unl...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
en
0.722085
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
1.897732
2
tests/adv/test_pop_sfrd.py
jlashner/ares
10
3442
""" test_pop_models.py Author: <NAME> Affiliation: UCLA Created on: Fri Jul 15 15:23:11 PDT 2016 Description: """ import ares import matplotlib.pyplot as pl PB = ares.util.ParameterBundle def test(): # Create a simple population pars_1 = PB('pop:fcoll') + PB('sed:bpass') pop_fcoll = ares.population...
""" test_pop_models.py Author: <NAME> Affiliation: UCLA Created on: Fri Jul 15 15:23:11 PDT 2016 Description: """ import ares import matplotlib.pyplot as pl PB = ares.util.ParameterBundle def test(): # Create a simple population pars_1 = PB('pop:fcoll') + PB('sed:bpass') pop_fcoll = ares.population...
en
0.504405
test_pop_models.py Author: <NAME> Affiliation: UCLA Created on: Fri Jul 15 15:23:11 PDT 2016 Description: # Create a simple population #pop_fcoll_XR = ares.populations.GalaxyPopulation(**pars_1) # Mimic the above population to check our different SFRD/SED techniques # pop_Ex? # Check the emissivities too #print(pop_f...
1.882801
2
venv/lib/python3.7/site-packages/leancloud/engine/utils.py
corgiclub/CorgiBot_telegram
0
3443
# coding: utf-8 import time import hashlib import leancloud from leancloud._compat import to_bytes __author__ = 'asaka <<EMAIL>>' def sign_by_key(timestamp, key): return hashlib.md5(to_bytes('{0}{1}'.format(timestamp, key))).hexdigest()
# coding: utf-8 import time import hashlib import leancloud from leancloud._compat import to_bytes __author__ = 'asaka <<EMAIL>>' def sign_by_key(timestamp, key): return hashlib.md5(to_bytes('{0}{1}'.format(timestamp, key))).hexdigest()
en
0.833554
# coding: utf-8
1.981763
2
AirplaneLQR/chap4LQR/mavsim_chap4.py
eyler94/ee674AirplaneSim
1
3444
<filename>AirplaneLQR/chap4LQR/mavsim_chap4.py<gh_stars>1-10 """ mavsimPy - Chapter 4 assignment for <NAME>, PUP, 2012 - Update history: 12/27/2018 - RWB 1/17/2019 - RWB """ import sys sys.path.append('..') import numpy as np import parameters.simulation_parameters as SIM from chap2.mav_viewe...
<filename>AirplaneLQR/chap4LQR/mavsim_chap4.py<gh_stars>1-10 """ mavsimPy - Chapter 4 assignment for <NAME>, PUP, 2012 - Update history: 12/27/2018 - RWB 1/17/2019 - RWB """ import sys sys.path.append('..') import numpy as np import parameters.simulation_parameters as SIM from chap2.mav_viewe...
en
0.577376
mavsimPy - Chapter 4 assignment for <NAME>, PUP, 2012 - Update history: 12/27/2018 - RWB 1/17/2019 - RWB # from chap2.video_writer import video_writer # initialize the visualization # True==write video, False==don't write video # initialize the mav viewer # initialize view of data plots # init...
2.520713
3
core/self6dpp/tools/ycbv/ycbv_pbr_so_mlBCE_Double_3_merge_train_real_uw_init_results_with_refined_poses_to_json.py
THU-DA-6D-Pose-Group/self6dpp
33
3445
<gh_stars>10-100 import os.path as osp import sys import numpy as np import mmcv from tqdm import tqdm from functools import cmp_to_key cur_dir = osp.dirname(osp.abspath(__file__)) PROJ_ROOT = osp.normpath(osp.join(cur_dir, "../../../../")) sys.path.insert(0, PROJ_ROOT) from lib.pysixd import inout, misc from lib.util...
import os.path as osp import sys import numpy as np import mmcv from tqdm import tqdm from functools import cmp_to_key cur_dir = osp.dirname(osp.abspath(__file__)) PROJ_ROOT = osp.normpath(osp.join(cur_dir, "../../../../")) sys.path.insert(0, PROJ_ROOT) from lib.pysixd import inout, misc from lib.utils.bbox_utils impo...
en
0.547741
# [1.3360, -0.5000, 3.5105] # [0.5575, 1.7005, 4.8050] # [-0.9520, 1.4670, 4.3645] # [-0.0240, -1.5270, 8.4035] # [1.2995, 2.4870, -11.8290] # [-0.1565, 0.1150, 4.2625] # [1.1645, -4.2015, 3.1190] # [1.4460, -0.5915, 3.6085] # [2.4195, 0.3075, 8.0715] # [-18.6730, 12.1915, -1.4635] # [5.3370, 5.8855, 25.6115] # [4.9290...
1.761722
2
tests/test_app/rest_app/rest_app/services/account_service.py
jadbin/guniflask
12
3446
<filename>tests/test_app/rest_app/rest_app/services/account_service.py from flask import abort from guniflask.context import service from ..config.jwt_config import jwt_manager @service class AccountService: accounts = { 'root': { 'authorities': ['role_admin'], 'password': '<PASSW...
<filename>tests/test_app/rest_app/rest_app/services/account_service.py from flask import abort from guniflask.context import service from ..config.jwt_config import jwt_manager @service class AccountService: accounts = { 'root': { 'authorities': ['role_admin'], 'password': '<PASSW...
none
1
2.280013
2
test/library/draft/DataFrames/psahabu/AddSeries.py
jhh67/chapel
1,602
3447
<gh_stars>1000+ import pandas as pd I = ["A", "B", "C", "D", "E"] oneDigit = pd.Series([1, 2, 3, 4, 5], pd.Index(I)) twoDigit = pd.Series([10, 20, 30, 40, 50], pd.Index(I)) print "addends:" print oneDigit print twoDigit print print "sum:" print oneDigit + twoDigit print I2 = ["A", "B", "C"] I3 = ["B", "C", "D", "E"...
import pandas as pd I = ["A", "B", "C", "D", "E"] oneDigit = pd.Series([1, 2, 3, 4, 5], pd.Index(I)) twoDigit = pd.Series([10, 20, 30, 40, 50], pd.Index(I)) print "addends:" print oneDigit print twoDigit print print "sum:" print oneDigit + twoDigit print I2 = ["A", "B", "C"] I3 = ["B", "C", "D", "E"] X = pd.Series(...
none
1
3.527162
4
nelly/parser.py
shawcx/nelly
0
3448
<gh_stars>0 # # (c) 2008-2020 <NAME> # import sys import os import re import logging import nelly from .scanner import Scanner from .program import Program from .types import * class Parser(object): def __init__(self, include_dirs=[]): self.include_dirs = include_dirs + [ os.path.join(nelly.root, 'gr...
# # (c) 2008-2020 <NAME> # import sys import os import re import logging import nelly from .scanner import Scanner from .program import Program from .types import * class Parser(object): def __init__(self, include_dirs=[]): self.include_dirs = include_dirs + [ os.path.join(nelly.root, 'grammars') ] ...
en
0.801962
# # (c) 2008-2020 <NAME> # # setup the scanner based on the regular expressions # container for the compiled program # keep a reference to the tokens for when included files are parsed # iterate over all the tokens # handle all the top-level tokens # create a new container and add it to the program # parse any optional...
2.665712
3
qcodes/utils/installation_info.py
zhinst/Qcodes
1
3449
<filename>qcodes/utils/installation_info.py """ This module contains helper functions that provide information about how QCoDeS is installed and about what other packages are installed along with QCoDeS """ import sys from typing import Dict, List, Optional import subprocess import json import logging import requiremen...
<filename>qcodes/utils/installation_info.py """ This module contains helper functions that provide information about how QCoDeS is installed and about what other packages are installed along with QCoDeS """ import sys from typing import Dict, List, Optional import subprocess import json import logging import requiremen...
en
0.896352
This module contains helper functions that provide information about how QCoDeS is installed and about what other packages are installed along with QCoDeS # 3.7 and earlier Try to ask pip whether QCoDeS is installed in editable mode and return the answer a boolean. Returns None if pip somehow did not respond as ...
2.385558
2
documents/views.py
brandonrobertz/foia-pdf-processing-system
0
3450
<reponame>brandonrobertz/foia-pdf-processing-system<filename>documents/views.py from django.shortcuts import render from django.http import JsonResponse from .models import FieldCategory def fieldname_values(request): if request.method == "GET": fieldname = request.GET['fieldname'] query = reques...
from django.shortcuts import render from django.http import JsonResponse from .models import FieldCategory def fieldname_values(request): if request.method == "GET": fieldname = request.GET['fieldname'] query = request.GET.get('q') q_kwargs= dict( fieldname=fieldname, ...
en
0.91111
# just let it explode if people don't POST properly
2.258786
2
tests/test_provider_Mongey_kafka_connect.py
mjuenema/python-terrascript
507
3451
# tests/test_provider_Mongey_kafka-connect.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:20:11 UTC) def test_provider_import(): import terrascript.provider.Mongey.kafka_connect def test_resource_import(): from terrascript.resource.Mongey.kafka_connect import kafka_connect_connector # T...
# tests/test_provider_Mongey_kafka-connect.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:20:11 UTC) def test_provider_import(): import terrascript.provider.Mongey.kafka_connect def test_resource_import(): from terrascript.resource.Mongey.kafka_connect import kafka_connect_connector # T...
en
0.575903
# tests/test_provider_Mongey_kafka-connect.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:20:11 UTC) # TODO: Shortcut imports without namespace for official and supported providers. # TODO: This has to be moved into a required_providers block. # def test_version_source(): # # import terrascript....
1.864593
2
application.py
nicholsont/catalog_app
0
3452
from flask import Flask, render_template, request, redirect, jsonify, g from flask import url_for, flash, make_response from flask import session as login_session from sqlalchemy import create_engine, asc from sqlalchemy.orm import sessionmaker from models import Base, Category, Item, User from oauth2client.client impo...
from flask import Flask, render_template, request, redirect, jsonify, g from flask import url_for, flash, make_response from flask import session as login_session from sqlalchemy import create_engine, asc from sqlalchemy.orm import sessionmaker from models import Base, Category, Item, User from oauth2client.client impo...
en
0.558966
# Retrieves client ID's and secrets from the json files # Connect to Database and create database session # Login handler JSON API to view entire catalog Information. # Third Party Oauth callback Retrieves provider to process oauth login. params:(string) oauth provider # Upgrade auth code into credentials object # ...
2.473706
2
noo/impl/utils/__init__.py
nooproject/noo
2
3453
from .echo import echo, set_quiet from .errors import NooException, cancel from .store import STORE, FileStore, Store __all__ = ( "FileStore", "NooException", "Store", "STORE", "cancel", "echo", "set_quiet", )
from .echo import echo, set_quiet from .errors import NooException, cancel from .store import STORE, FileStore, Store __all__ = ( "FileStore", "NooException", "Store", "STORE", "cancel", "echo", "set_quiet", )
none
1
1.307607
1
ai2thor/server.py
aliang8/ai2thor
1
3454
<filename>ai2thor/server.py<gh_stars>1-10 # Copyright Allen Institute for Artificial Intelligence 2017 """ ai2thor.server Handles all communication with Unity through a Flask service. Messages are sent to the controller using a pair of request/response queues. """ import json import logging import sys import os imp...
<filename>ai2thor/server.py<gh_stars>1-10 # Copyright Allen Institute for Artificial Intelligence 2017 """ ai2thor.server Handles all communication with Unity through a Flask service. Messages are sent to the controller using a pair of request/response queues. """ import json import logging import sys import os imp...
en
0.731829
# Copyright Allen Institute for Artificial Intelligence 2017 ai2thor.server Handles all communication with Unity through a Flask service. Messages are sent to the controller using a pair of request/response queues. # get with timeout to allow quit # XXX add methods for depth,sem_seg Object that is returned from a cal...
2.513973
3
setup.py
ooreilly/mydocstring
13
3455
<filename>setup.py from setuptools import setup setup(name='mydocstring', version='0.2.7', description="""A tool for extracting and converting Google-style docstrings to plain-text, markdown, and JSON.""", url='http://github.com/ooreilly/mydocstring', author="<NAME>", license='MIT'...
<filename>setup.py from setuptools import setup setup(name='mydocstring', version='0.2.7', description="""A tool for extracting and converting Google-style docstrings to plain-text, markdown, and JSON.""", url='http://github.com/ooreilly/mydocstring', author="<NAME>", license='MIT'...
en
0.724005
A tool for extracting and converting Google-style docstrings to plain-text, markdown, and JSON.
1.858258
2
anyser/impls/bson.py
Cologler/anyser-python
0
3456
# -*- coding: utf-8 -*- # # Copyright (c) 2020~2999 - Cologler <<EMAIL>> # ---------- # # ---------- import bson import struct from ..err import SerializeError from ..abc import * from ..core import register_format @register_format('bson', '.bson') class BsonSerializer(ISerializer): format_name = 'bson' def...
# -*- coding: utf-8 -*- # # Copyright (c) 2020~2999 - Cologler <<EMAIL>> # ---------- # # ---------- import bson import struct from ..err import SerializeError from ..abc import * from ..core import register_format @register_format('bson', '.bson') class BsonSerializer(ISerializer): format_name = 'bson' def...
en
0.474945
# -*- coding: utf-8 -*- # # Copyright (c) 2020~2999 - Cologler <<EMAIL>> # ---------- # # ----------
2.278643
2
tests/test_config_parser.py
KevinMFong/pyhocon
424
3457
# -*- encoding: utf-8 -*- import json import os import shutil import tempfile from collections import OrderedDict from datetime import timedelta from pyparsing import ParseBaseException, ParseException, ParseSyntaxException import mock import pytest from pyhocon import (ConfigFactory, ConfigParser, ConfigSubstitution...
# -*- encoding: utf-8 -*- import json import os import shutil import tempfile from collections import OrderedDict from datetime import timedelta from pyparsing import ParseBaseException, ParseException, ParseSyntaxException import mock import pytest from pyhocon import (ConfigFactory, ConfigParser, ConfigSubstitution...
en
0.305274
# -*- encoding: utf-8 -*- t = { c = 5 "d" = true e.y = { f: 7 g: "hey dude!" h: hey man i = \"\"\" "first line" "second" line ...
2.457177
2
scenario_runner/srunner/scenariomanager/scenario_manager.py
cgeller/WorldOnRails
447
3458
<reponame>cgeller/WorldOnRails<gh_stars>100-1000 #!/usr/bin/env python # Copyright (c) 2018-2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ This module provides the ScenarioManager implementation. It must not be modified...
#!/usr/bin/env python # Copyright (c) 2018-2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ This module provides the ScenarioManager implementation. It must not be modified and is for reference only! """ from __future__ ...
en
0.739521
#!/usr/bin/env python # Copyright (c) 2018-2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. This module provides the ScenarioManager implementation. It must not be modified and is for reference only! Basic scenario manager clas...
2.785797
3
edb/schema/referencing.py
disfated/edgedb
0
3459
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
en
0.891692
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
1.674526
2
tools.py
Jakuko99/effectb
1
3460
from calendar import month_name class Tools: def __init__(self): self.output = "" def formatDate(self, date): elements = date.split("-") return f"{elements[2]}. {month_name[int(elements[1])]} {elements[0]}" def shortenText(self, string, n): #return first n sentences from strin...
from calendar import month_name class Tools: def __init__(self): self.output = "" def formatDate(self, date): elements = date.split("-") return f"{elements[2]}. {month_name[int(elements[1])]} {elements[0]}" def shortenText(self, string, n): #return first n sentences from strin...
en
0.756137
#return first n sentences from string #remove last ', '
3.349295
3
Bugscan_exploits-master/exp_list/exp-2307.py
csadsl/poc_exp
11
3461
#!/usr/bin/env python # -*- coding: utf-8 -*- #__Author__ = 烽火戏诸侯 #_PlugName_ = Shop7z /admin/lipinadd.asp越权访问 import re def assign(service, arg): if service == "shop7z": return True, arg def audit(arg): payload = 'admin/lipinadd.asp' target = arg + payload code, head,res, errcode...
#!/usr/bin/env python # -*- coding: utf-8 -*- #__Author__ = 烽火戏诸侯 #_PlugName_ = Shop7z /admin/lipinadd.asp越权访问 import re def assign(service, arg): if service == "shop7z": return True, arg def audit(arg): payload = 'admin/lipinadd.asp' target = arg + payload code, head,res, errcode...
en
0.36428
#!/usr/bin/env python # -*- coding: utf-8 -*- #__Author__ = 烽火戏诸侯 #_PlugName_ = Shop7z /admin/lipinadd.asp越权访问
2.088125
2
homeassistant/components/hue/light.py
dlangerm/core
5
3462
"""Support for the Philips Hue lights.""" from __future__ import annotations from datetime import timedelta from functools import partial import logging import random import aiohue import async_timeout from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_FL...
"""Support for the Philips Hue lights.""" from __future__ import annotations from datetime import timedelta from functools import partial import logging import random import aiohue import async_timeout from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_FL...
en
0.835609
Support for the Philips Hue lights. # Minimum Hue Bridge API version to support groups # 1.4.0 introduced extended group info # 1.12 introduced the state object for groups # 1.13 introduced "any_on" to group state objects Old way of setting up Hue lights. Can only be called when a user accidentally mentions hue pl...
2.12659
2
src/ezdxf/math/bulge.py
dmtvanzanten/ezdxf
0
3463
<gh_stars>0 # Copyright (c) 2018-2021 <NAME> # License: MIT License # source: http://www.lee-mac.com/bulgeconversion.html # source: http://www.afralisp.net/archive/lisp/Bulges1.htm from typing import Any, TYPE_CHECKING, Tuple import math from ezdxf.math import Vec2 if TYPE_CHECKING: from ezdxf.eztypes import Verte...
# Copyright (c) 2018-2021 <NAME> # License: MIT License # source: http://www.lee-mac.com/bulgeconversion.html # source: http://www.afralisp.net/archive/lisp/Bulges1.htm from typing import Any, TYPE_CHECKING, Tuple import math from ezdxf.math import Vec2 if TYPE_CHECKING: from ezdxf.eztypes import Vertex __all__ =...
en
0.677599
# Copyright (c) 2018-2021 <NAME> # License: MIT License # source: http://www.lee-mac.com/bulgeconversion.html # source: http://www.afralisp.net/archive/lisp/Bulges1.htm Returns the point at a specified `angle` and `distance` from point `p`. Args: p: point as :class:`Vec2` compatible object angle: a...
3.028017
3
Plugins/Aspose.Email Java for Python/tests/ProgrammingEmail/ManageAttachments/ManageAttachments.py
aspose-email/Aspose.Email-for-Java
24
3464
<gh_stars>10-100 # To change this license header, choose License Headers in Project Properties. # To change this template file, choose Tools | Templates # and open the template in the editor. #if __name__ == "__main__": # print "Hello World" from ProgrammingEmail import ManageAttachments import jpype import os.pat...
# To change this license header, choose License Headers in Project Properties. # To change this template file, choose Tools | Templates # and open the template in the editor. #if __name__ == "__main__": # print "Hello World" from ProgrammingEmail import ManageAttachments import jpype import os.path asposeapispath...
en
0.52592
# To change this license header, choose License Headers in Project Properties. # To change this template file, choose Tools | Templates # and open the template in the editor. #if __name__ == "__main__": # print "Hello World" #print dataDir
1.985525
2
mypython/keys.py
asmeurer/mypython
27
3465
from prompt_toolkit.key_binding.bindings.named_commands import (accept_line, self_insert, backward_delete_char, beginning_of_line) from prompt_toolkit.key_binding.bindings.basic import if_no_repeat from prompt_toolkit.key_binding.bindings.basic import load_basic_bindings from prompt_toolkit.key_binding.bindings.ema...
from prompt_toolkit.key_binding.bindings.named_commands import (accept_line, self_insert, backward_delete_char, beginning_of_line) from prompt_toolkit.key_binding.bindings.basic import if_no_repeat from prompt_toolkit.key_binding.bindings.basic import load_basic_bindings from prompt_toolkit.key_binding.bindings.ema...
en
0.830129
# Based on prompt_toolkit.key_binding.defaults.load_key_bindings() # Handle SyntaxErrorMessage which is the same warning for the whole # line. # This can be removed once # https://github.com/prompt-toolkit/python-prompt-toolkit/pull/857 is in a # released version of prompt-toolkit. Move to the beginning Move to the end...
1.800799
2
demand/preday_model_estimation/isg.py
gusugusu1018/simmobility-prod
50
3466
from biogeme import * from headers import * from loglikelihood import * from statistics import * from nested import * #import random cons_work= Beta('cons for work', 0,-10,10,0) cons_edu = Beta('cons for education',0,-50,10,0) cons_shopping = Beta('cons for shopping',0,-10,10,0) cons_...
from biogeme import * from headers import * from loglikelihood import * from statistics import * from nested import * #import random cons_work= Beta('cons for work', 0,-10,10,0) cons_edu = Beta('cons for education',0,-50,10,0) cons_shopping = Beta('cons for shopping',0,-10,10,0) cons_...
en
0.784641
#import random #V for work #V for education #V for shopping #V for other #V for quit #prob = bioLogit(V,av,stop_type)
2.156029
2
HRMS/app/__init__.py
freestyletime/HumanResourceManagement
1
3467
# 初始化模块 from config import Config from flask import Flask from flask_sqlalchemy import SQLAlchemy # 数据库操作对象 db = SQLAlchemy() # 创建app def create_app(): # flask操作对象 app = Flask(__name__) # 通过配置文件读取并应用配置 app.config.from_object(Config) # 初始化数据库 db.init_app(app) # 员工管理子系统 from app.view i...
# 初始化模块 from config import Config from flask import Flask from flask_sqlalchemy import SQLAlchemy # 数据库操作对象 db = SQLAlchemy() # 创建app def create_app(): # flask操作对象 app = Flask(__name__) # 通过配置文件读取并应用配置 app.config.from_object(Config) # 初始化数据库 db.init_app(app) # 员工管理子系统 from app.view i...
zh
0.991247
# 初始化模块 # 数据库操作对象 # 创建app # flask操作对象 # 通过配置文件读取并应用配置 # 初始化数据库 # 员工管理子系统 # 职位管理子系统 # 部门管理子系统 # 工资管理子系统 # 考勤管理子系统 # 统一对外接口蓝本
2.694589
3
listener/src/ethereum_connection.py
NicolasMenendez/oracles-dashboard
0
3468
<filename>listener/src/ethereum_connection.py<gh_stars>0 import json import web3 class EthereumConnection(): def __init__(self, url_node): self._url_node = url_node self._node_provider = web3.HTTPProvider(self._url_node) self._w3 = web3.Web3(self._node_provider) @property def w3(s...
<filename>listener/src/ethereum_connection.py<gh_stars>0 import json import web3 class EthereumConnection(): def __init__(self, url_node): self._url_node = url_node self._node_provider = web3.HTTPProvider(self._url_node) self._w3 = web3.Web3(self._node_provider) @property def w3(s...
none
1
2.486752
2
ross/stochastic/st_results.py
JuliaMota/ross
0
3469
<reponame>JuliaMota/ross<filename>ross/stochastic/st_results.py<gh_stars>0 """STOCHASTIC ROSS plotting module. This module returns graphs for each type of analyses in st_rotor_assembly.py. """ import numpy as np from plotly import express as px from plotly import graph_objects as go from plotly import io as pio from p...
"""STOCHASTIC ROSS plotting module. This module returns graphs for each type of analyses in st_rotor_assembly.py. """ import numpy as np from plotly import express as px from plotly import graph_objects as go from plotly import io as pio from plotly.subplots import make_subplots from ross.plotly_theme import tableau_...
en
0.711071
STOCHASTIC ROSS plotting module. This module returns graphs for each type of analyses in st_rotor_assembly.py. # set Plotly palette of colors Store stochastic results and provide plots for Campbell Diagram. It's possible to visualize multiples harmonics in a single plot to check other speeds which also excite...
2.461655
2
code/prisonersDilemma.py
ben9583/PrisonersDilemmaTournament
1
3470
import os import itertools import importlib import numpy as np import random STRATEGY_FOLDER = "exampleStrats" RESULTS_FILE = "results.txt" pointsArray = [[1,5],[0,3]] # The i-j-th element of this array is how many points you receive if you do play i, and your opponent does play j. moveLabels = ["D","C"] #...
import os import itertools import importlib import numpy as np import random STRATEGY_FOLDER = "exampleStrats" RESULTS_FILE = "results.txt" pointsArray = [[1,5],[0,3]] # The i-j-th element of this array is how many points you receive if you do play i, and your opponent does play j. moveLabels = ["D","C"] #...
en
0.960533
# The i-j-th element of this array is how many points you receive if you do play i, and your opponent does play j. # D = defect, betray, sabotage, free-ride, etc. # C = cooperate, stay silent, comply, upload files, etc. # Returns a 2-by-n numpy array. The first axis is which player (0 = us, 1 = opp...
3.738442
4
json_to_relation/mysqldb.py
paepcke/json_to_relation
4
3471
# Copyright (c) 2014, Stanford University # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the ...
# Copyright (c) 2014, Stanford University # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the ...
en
0.650219
# Copyright (c) 2014, Stanford University # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the ...
1.612679
2
tools/xkeydump.py
treys/crypto-key-derivation
29
3472
<reponame>treys/crypto-key-derivation #!./venv/bin/python from lib.mbp32 import XKey from lib.utils import one_line_from_stdin xkey = XKey.from_xkey(one_line_from_stdin()) print(xkey) print("Version:", xkey.version) print("Depth:", xkey.depth) print("Parent FP:", xkey.parent_fp.hex()) print("Child number:", xkey.chil...
#!./venv/bin/python from lib.mbp32 import XKey from lib.utils import one_line_from_stdin xkey = XKey.from_xkey(one_line_from_stdin()) print(xkey) print("Version:", xkey.version) print("Depth:", xkey.depth) print("Parent FP:", xkey.parent_fp.hex()) print("Child number:", xkey.child_number_with_tick()) print("Chain cod...
ru
0.115955
#!./venv/bin/python
2.216146
2
examples/compute_angular_resolution.py
meder411/Tangent-Images
57
3473
from spherical_distortion.util import * sample_order = 9 # Input resolution to examine def ang_fov(s): print('Spherical Resolution:', s) for b in range(s): dim = tangent_image_dim(b, s) # Pixel dimension of tangent image corners = tangent_image_corners(b, s) # Corners of each tangent image ...
from spherical_distortion.util import * sample_order = 9 # Input resolution to examine def ang_fov(s): print('Spherical Resolution:', s) for b in range(s): dim = tangent_image_dim(b, s) # Pixel dimension of tangent image corners = tangent_image_corners(b, s) # Corners of each tangent image ...
en
0.763499
# Input resolution to examine # Pixel dimension of tangent image # Corners of each tangent image
2.97162
3
polymath/srdfg/base.py
he-actlab/polymath
15
3474
from polymath import UNSET_SHAPE, DEFAULT_SHAPES import builtins import operator from collections import OrderedDict, Mapping, Sequence, deque import functools from numbers import Integral, Rational, Real import contextlib import traceback import uuid import numpy as np import importlib from .graph import Graph from ....
from polymath import UNSET_SHAPE, DEFAULT_SHAPES import builtins import operator from collections import OrderedDict, Mapping, Sequence, deque import functools from numbers import Integral, Rational, Real import contextlib import traceback import uuid import numpy as np import importlib from .graph import Graph from ....
en
0.61789
Base class for nodes. Parameters ---------- args : tuple Positional arguments passed to the `_evaluate` method. name : str or None Name of the node or `None` to use a random, unique identifier. shape : tuple or None Shape of the output for a node. This can be a tuple of inte...
2.532946
3
actors/models.py
rngallen/beyond_basics
0
3475
<gh_stars>0 from django.db import models from django.utils.translation import ugettext_lazy as _ # Create your models here. class Actor(models.Model): name = models.CharField(_("name"), max_length=200) # if is_star he/she will be directed to hollywood else directed to commercial is_star = models.BooleanF...
from django.db import models from django.utils.translation import ugettext_lazy as _ # Create your models here. class Actor(models.Model): name = models.CharField(_("name"), max_length=200) # if is_star he/she will be directed to hollywood else directed to commercial is_star = models.BooleanField(_("is s...
en
0.965854
# Create your models here. # if is_star he/she will be directed to hollywood else directed to commercial
2.607765
3
docs/buildscripts/docs.py
cwlalyy/mongo-c-driver
13
3476
"""Build the C client docs. """ from __future__ import with_statement import os import shutil import socket import subprocess import time import urllib2 def clean_dir(dir): try: shutil.rmtree(dir) except: pass os.makedirs(dir) def gen_api(dir): clean_dir(dir) clean_dir("docs/sourc...
"""Build the C client docs. """ from __future__ import with_statement import os import shutil import socket import subprocess import time import urllib2 def clean_dir(dir): try: shutil.rmtree(dir) except: pass os.makedirs(dir) def gen_api(dir): clean_dir(dir) clean_dir("docs/sourc...
en
0.830118
Build the C client docs. Get the driver version from doxygenConfig.
2.482007
2
tilegame/render/rs.py
defgsus/thegame
1
3477
import glm import math from lib.opengl import RenderSettings class GameProjection: def __init__(self, rs: "GameRenderSettings"): self.rs = rs self.scale = 10. self.rotation_deg = 0. self.location = glm.vec3(0) self._stack = [] def projection_matrix_4(self) -> glm.mat...
import glm import math from lib.opengl import RenderSettings class GameProjection: def __init__(self, rs: "GameRenderSettings"): self.rs = rs self.scale = 10. self.rotation_deg = 0. self.location = glm.vec3(0) self._stack = [] def projection_matrix_4(self) -> glm.mat...
none
1
2.386523
2
tools/stats/export_slow_tests.py
stungkit/pytorch
2
3478
<gh_stars>1-10 #!/usr/bin/env python3 import argparse import json import os import statistics from collections import defaultdict from tools.stats.s3_stat_parser import ( get_previous_reports_for_branch, Report, Version2Report, ) from typing import cast, DefaultDict, Dict, List, Any from urllib.request imp...
#!/usr/bin/env python3 import argparse import json import os import statistics from collections import defaultdict from tools.stats.s3_stat_parser import ( get_previous_reports_for_branch, Report, Version2Report, ) from typing import cast, DefaultDict, Dict, List, Any from urllib.request import urlopen SL...
en
0.821935
#!/usr/bin/env python3 # an entry will be like ("test_doc_examples (__main__.TestTypeHints)" -> [values])) # type: ignore[misc] # The below attaches a __main__ as that matches the format of test.__class__ in # common_utils.py (where this data will be used), and also matches what the output # of a running test would loo...
2.274421
2
ml/rl/evaluation/weighted_sequential_doubly_robust_estimator.py
michaeltashman/Horizon
1
3479
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import itertools import logging import numpy as np import scipy as sp import torch from ml.rl.evaluation.cpe import CpeEstimate from ml.rl.evaluation.evaluation_data_page import EvaluationDataPage logger = logging.getLogg...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import itertools import logging import numpy as np import scipy as sp import torch from ml.rl.evaluation.cpe import CpeEstimate from ml.rl.evaluation.evaluation_data_page import EvaluationDataPage logger = logging.getLogg...
en
0.797274
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # For details, visit https://arxiv.org/pdf/1604.00923.pdf Section 5, 7, 8 # break trajectories into several subsets to estimate confidence bounds # Compute weighted_doubly_robust mean point estimate using all data # Use boots...
2.011507
2
LeetCode/2019-08-03-384-Shuffle-an-Array.py
HeRuivio/-Algorithm
5
3480
# -*- coding: utf-8 -*- # @Author: 何睿 # @Create Date: 2019-08-03 10:48:30 # @Last Modified by: 何睿 # @Last Modified time: 2019-08-03 10:53:15 import copy import random from typing import List class Solution: def __init__(self, nums: List[int]): self.shuffle_ = nums self.orig...
# -*- coding: utf-8 -*- # @Author: 何睿 # @Create Date: 2019-08-03 10:48:30 # @Last Modified by: 何睿 # @Last Modified time: 2019-08-03 10:53:15 import copy import random from typing import List class Solution: def __init__(self, nums: List[int]): self.shuffle_ = nums self.orig...
en
0.739654
# -*- coding: utf-8 -*- # @Author: 何睿 # @Create Date: 2019-08-03 10:48:30 # @Last Modified by: 何睿 # @Last Modified time: 2019-08-03 10:53:15 Resets the array to its original configuration and return it. Returns a random shuffling of the array.
3.824387
4
src/wspc/feature_selection.py
shakedna1/wspc_rep
0
3481
import numpy as np import sklearn import pandas as pd import scipy.spatial.distance as ssd from scipy.cluster import hierarchy from scipy.stats import chi2_contingency from sklearn.base import BaseEstimator from sklearn.ensemble import RandomForestClassifier from sklearn.feature_extraction.text import CountVectorizer f...
import numpy as np import sklearn import pandas as pd import scipy.spatial.distance as ssd from scipy.cluster import hierarchy from scipy.stats import chi2_contingency from sklearn.base import BaseEstimator from sklearn.ensemble import RandomForestClassifier from sklearn.feature_extraction.text import CountVectorizer f...
en
0.775792
A transformer that clusters the features in X according to dist_matrix, and selects a feature from each cluster with the highest chi2 score of X[feature] versus y Calculates phi coefficient between features Parameters ---------- x - feature x column y - feature y column Ret...
2.639238
3
Python3/PS_scraping_selenium.py
fsj-digital/pages
5
3482
from bs4 import BeautifulSoup import requests import re from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium import webdriver from seleni...
from bs4 import BeautifulSoup import requests import re from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium import webdriver from seleni...
en
0.732656
# Print row with HTML formatting # Google Search "Selenium" # Google Search "Google Pixel 3" # Required for the input tag visibility # proceed if element is found within 3 seconds otherwise raise TimeoutException # with visibility search # Required for the button visibility # with visibility search # Required for the b...
3.039251
3
AppTest/testTCPserver.py
STRATOLOGIC/SpacePyLibrary
22
3483
#!/usr/bin/env python3 #****************************************************************************** # (C) 2018, <NAME>, Austria * # * # The Space Python Library is free software; you can redistribut...
#!/usr/bin/env python3 #****************************************************************************** # (C) 2018, <NAME>, Austria * # * # The Space Python Library is free software; you can redistribut...
en
0.617351
#!/usr/bin/env python3 #****************************************************************************** # (C) 2018, <NAME>, Austria * # * # The Space Python Library is free software; you can redistribut...
1.624168
2
tests/clientlib_test.py
yoavcaspi/pre-commit
0
3484
<reponame>yoavcaspi/pre-commit from __future__ import unicode_literals import logging import cfgv import pytest import pre_commit.constants as C from pre_commit.clientlib import check_type_tag from pre_commit.clientlib import CONFIG_HOOK_DICT from pre_commit.clientlib import CONFIG_REPO_DICT from pre_commit.clientli...
from __future__ import unicode_literals import logging import cfgv import pytest import pre_commit.constants as C from pre_commit.clientlib import check_type_tag from pre_commit.clientlib import CONFIG_HOOK_DICT from pre_commit.clientlib import CONFIG_REPO_DICT from pre_commit.clientlib import CONFIG_SCHEMA from pre...
en
0.696914
# Exclude pattern must be a string Due to the way our merging works, if this schema has any defaults they will clobber potentially useful values in the backing manifest. #227 # A regression in 0.13.5: always_run and files are permissible # i-dont-exist isn't a valid hook # invalid to set a language for a meta hook ...
1.817221
2
ikalog/ui/options.py
fetus-hina/IkaLog
285
3485
<reponame>fetus-hina/IkaLog #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
en
0.805743
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
2.126299
2
setup.py
CyberTKR/Simple-LINELIB
4
3486
from setuptools import setup, find_packages with open("README.md", 'r',encoding="utf-8") as f: long_description = f.read() setup( name='LineBot', version='0.1.0', description='Simple-LINELIB', long_description=long_description, author='<NAME>', author_email='<EMAIL>', url='https://gith...
from setuptools import setup, find_packages with open("README.md", 'r',encoding="utf-8") as f: long_description = f.read() setup( name='LineBot', version='0.1.0', description='Simple-LINELIB', long_description=long_description, author='<NAME>', author_email='<EMAIL>', url='https://gith...
none
1
1.342173
1
lib/SeparateDriver/CgwshDeviceDriverSetParameterECDB.py
multi-service-fabric/element-manager
0
3487
<filename>lib/SeparateDriver/CgwshDeviceDriverSetParameterECDB.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(c) 2019 Nippon Telegraph and Telephone Corporation # Filename: CgwshDeviceDriverSetParameterECDB.py ''' Parameter module for Cgwsh driver configuration ''' import GlobalModule from EmCom...
<filename>lib/SeparateDriver/CgwshDeviceDriverSetParameterECDB.py #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(c) 2019 Nippon Telegraph and Telephone Corporation # Filename: CgwshDeviceDriverSetParameterECDB.py ''' Parameter module for Cgwsh driver configuration ''' import GlobalModule from EmCom...
en
0.733871
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(c) 2019 Nippon Telegraph and Telephone Corporation # Filename: CgwshDeviceDriverSetParameterECDB.py Parameter module for Cgwsh driver configuration Parameter class for Cgwsh driver configuration Constructor Service information is acquired. Management information...
2.011457
2
scripts/common_lib/build_lib.py
Bhaskers-Blu-Org1/wc-devops-utilities
15
3488
<filename>scripts/common_lib/build_lib.py #!/usr/bin/env python3.6 import os import subprocess import json import argparse import zipfile import shutil import requests import datetime import re import operator import unicodedata # global list of error messages to keep track of all error msgs errorMessages = [] """ C...
<filename>scripts/common_lib/build_lib.py #!/usr/bin/env python3.6 import os import subprocess import json import argparse import zipfile import shutil import requests import datetime import re import operator import unicodedata # global list of error messages to keep track of all error msgs errorMessages = [] """ C...
en
0.716469
#!/usr/bin/env python3.6 # global list of error messages to keep track of all error msgs Collection of Common Functions used by Build Scripts A collection of common functions shared by each individual build scripts. HTTP/HTTPS GET requests using external Python module requests @param url the url of the REST call ...
2.51045
3
src/static_grasp_kt.py
ivalab/GraspKpNet
16
3489
<filename>src/static_grasp_kt.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import _init_paths import os import json import cv2 import cv2.aruco as aruco import numpy as np import sys import rospy from std_msgs.msg import Bool from std_msgs.msg import...
<filename>src/static_grasp_kt.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import _init_paths import os import json import cv2 import cv2.aruco as aruco import numpy as np import sys import rospy from std_msgs.msg import Bool from std_msgs.msg import...
en
0.699544
# transformation from the robot base to aruco tag # default transformation from the camera to aruco tag # camera intrinsic matrix of Realsense D435 # distortion of Realsense D435 # initialize GKNet Detector # Publisher of perception result # parameters # aruco_dict_CL = aruco.Dictionary_get(aruco.DICT_6X6_250) # for th...
1.693801
2
source/utils/augmentations.py
dovietchinh/multi-task-classification
0
3490
<reponame>dovietchinh/multi-task-classification<filename>source/utils/augmentations.py<gh_stars>0 import numpy as np import cv2 import random def preprocess(img,img_size,padding=True): """[summary] Args: img (np.ndarray): images img_size (int,list,tuple): target size. eg: 224 , (224,224) or [...
import numpy as np import cv2 import random def preprocess(img,img_size,padding=True): """[summary] Args: img (np.ndarray): images img_size (int,list,tuple): target size. eg: 224 , (224,224) or [224,224] padding (bool): padding img before resize. Prevent from image distortion. Default...
en
0.408858
[summary] Args: img (np.ndarray): images img_size (int,list,tuple): target size. eg: 224 , (224,224) or [224,224] padding (bool): padding img before resize. Prevent from image distortion. Defaults to True. Returns: images (np.ndarray): images in target size # 'random_crop':ran...
2.767794
3
BaseTools/Source/Python/GenFds/CapsuleData.py
James992927108/uEFI_Edk2_Practice
6
3491
## @file # generate capsule # # Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found a...
## @file # generate capsule # # Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found a...
en
0.527154
## @file # generate capsule # # Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found a...
2.245879
2
CalculatingPi/pi_linear_plot.py
davidmallasen/Hello_MPI
0
3492
import matplotlib.pyplot as plt import numpy as np # Read data size = [] time = [] with open("pi_linear.txt") as file: for line in file.readlines(): x, y = line.split(',') size.append(int(x.strip())) time.append(float(y.strip())) # Plot data fig, ax = plt.subplots() ax.plot(size, tim...
import matplotlib.pyplot as plt import numpy as np # Read data size = [] time = [] with open("pi_linear.txt") as file: for line in file.readlines(): x, y = line.split(',') size.append(int(x.strip())) time.append(float(y.strip())) # Plot data fig, ax = plt.subplots() ax.plot(size, tim...
en
0.50732
# Read data # Plot data #ax.grid()
2.939503
3
esque_wire/protocol/structs/api/elect_preferred_leaders_response.py
real-digital/esque-wire
0
3493
<gh_stars>0 from typing import ClassVar, List, Optional from ...constants import ApiKey, ErrorCode from ..base import ResponseData class PartitionResult: partition_id: int error_code: ErrorCode error_message: Optional[str] def __init__(self, partition_id: int, error_code: ErrorCode, error_message: ...
from typing import ClassVar, List, Optional from ...constants import ApiKey, ErrorCode from ..base import ResponseData class PartitionResult: partition_id: int error_code: ErrorCode error_message: Optional[str] def __init__(self, partition_id: int, error_code: ErrorCode, error_message: Optional[str...
en
0.775418
:param partition_id: The partition id :type partition_id: int :param error_code: The result error, or zero if there was no error. :type error_code: ErrorCode :param error_message: The result message, or null if there was no error. :type error_message: Optional[str] :param topic: ...
2.46245
2
tests/stack_test.py
arthurlogilab/py_zipkin
225
3494
import mock import pytest import py_zipkin.storage @pytest.fixture(autouse=True, scope="module") def create_zipkin_attrs(): # The following tests all expect _thread_local.zipkin_attrs to exist: if it # doesn't, mock.patch will fail. py_zipkin.storage.ThreadLocalStack().get() def test_get_zipkin_attrs_r...
import mock import pytest import py_zipkin.storage @pytest.fixture(autouse=True, scope="module") def create_zipkin_attrs(): # The following tests all expect _thread_local.zipkin_attrs to exist: if it # doesn't, mock.patch will fail. py_zipkin.storage.ThreadLocalStack().get() def test_get_zipkin_attrs_r...
en
0.927446
# The following tests all expect _thread_local.zipkin_attrs to exist: if it # doesn't, mock.patch will fail. # Let's make sure this still works if we don't pass in a custom storage.
2.101361
2
myapp/processes/plotter.py
cp4cds/cp4cds-wps-template
0
3495
from pywps import Process, LiteralInput, ComplexInput, ComplexOutput from pywps import Format import logging LOGGER = logging.getLogger('PYWPS') import matplotlib # no X11 server ... must be run first # https://github.com/matplotlib/matplotlib/issues/3466/ matplotlib.use('Agg') import matplotlib.pylab as plt import...
from pywps import Process, LiteralInput, ComplexInput, ComplexOutput from pywps import Format import logging LOGGER = logging.getLogger('PYWPS') import matplotlib # no X11 server ... must be run first # https://github.com/matplotlib/matplotlib/issues/3466/ matplotlib.use('Agg') import matplotlib.pylab as plt import...
en
0.421692
# no X11 server ... must be run first # https://github.com/matplotlib/matplotlib/issues/3466/
2.321784
2
json_schema_checker/composed/__init__.py
zorgulle/json_schema_checker
0
3496
<filename>json_schema_checker/composed/__init__.py<gh_stars>0 from .composed import List from .composed import IntList
<filename>json_schema_checker/composed/__init__.py<gh_stars>0 from .composed import List from .composed import IntList
none
1
1.235554
1
backend/social_quiz.py
jmigual/socialQuiz
0
3497
# -*- coding: utf-8 -*- import json import os.path import random import re from flask import Flask, send_from_directory from flask import request, abort from flaskrun.flaskrun import flask_run import datab.social_database as db app = Flask(__name__) # Regular expression to only accept certain files fileChecker = r...
# -*- coding: utf-8 -*- import json import os.path import random import re from flask import Flask, send_from_directory from flask import request, abort from flaskrun.flaskrun import flask_run import datab.social_database as db app = Flask(__name__) # Regular expression to only accept certain files fileChecker = r...
en
0.643879
# -*- coding: utf-8 -*- # Regular expression to only accept certain files # pragma: no cover # To obtain the mail # for # SELECT id, COUNT(a.id), COUNT(a.id) FROM Room r INNER JOIN # SELECT status FROM Room WHERE id = 1 # if commented the first answer will be the correct one # SELECT 'question' FROM 'Question' WHERE 'i...
2.57946
3
astacus/node/snapshotter.py
aiven/astacus
19
3498
""" Copyright (c) 2020 Aiven Ltd See LICENSE for details """ from astacus.common import magic, utils from astacus.common.ipc import SnapshotFile, SnapshotHash, SnapshotState from astacus.common.progress import increase_worth_reporting, Progress from pathlib import Path from typing import Optional import base64 impo...
""" Copyright (c) 2020 Aiven Ltd See LICENSE for details """ from astacus.common import magic, utils from astacus.common.ipc import SnapshotFile, SnapshotHash, SnapshotState from astacus.common.progress import increase_worth_reporting, Progress from pathlib import Path from typing import Optional import base64 impo...
en
0.950665
Copyright (c) 2020 Aiven Ltd See LICENSE for details Snapshotter keeps track of files on disk, and their hashes. The hash on disk MAY change, which may require subsequent incremential snapshot and-or ignoring the files which have changed. The output to outside is just root object's hash, as well as list ...
2.327048
2
colcon_gradle/task/gradle/build.py
richiware/colcon-gradle
0
3499
<filename>colcon_gradle/task/gradle/build.py<gh_stars>0 # Copyright 2018 <NAME> # Licensed under the Apache License, Version 2.0 from distutils import dir_util import glob import os from pathlib import Path import shutil from colcon_core.environment import create_environment_scripts from colcon_core.logging import co...
<filename>colcon_gradle/task/gradle/build.py<gh_stars>0 # Copyright 2018 <NAME> # Licensed under the Apache License, Version 2.0 from distutils import dir_util import glob import os from pathlib import Path import shutil from colcon_core.environment import create_environment_scripts from colcon_core.logging import co...
en
0.7524
# Copyright 2018 <NAME> # Licensed under the Apache License, Version 2.0 Build gradle packages. # noqa: D107 # noqa: D102 # noqa: D102 # add jars and classes to CLASSPATH with wildcards # https://docs.oracle.com/javase/8/docs/technotes/tools/windows/classpath.html#A1100762 # remove anything on the destination tree but ...
1.976525
2