hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4506701b04228b402dcf017737b7b97e102a97 | 5,977 | py | Python | 2017/iker/day15.py | bbglab/adventofcode | 65b6d8331d10f229b59232882d60024b08d69294 | [
"MIT"
] | null | null | null | 2017/iker/day15.py | bbglab/adventofcode | 65b6d8331d10f229b59232882d60024b08d69294 | [
"MIT"
] | null | null | null | 2017/iker/day15.py | bbglab/adventofcode | 65b6d8331d10f229b59232882d60024b08d69294 | [
"MIT"
] | 3 | 2016-12-02T09:20:42.000Z | 2021-12-01T13:31:07.000Z | """
--- Day 15: Dueling Generators ---
Here, you encounter a pair of dueling generators. The generators, called generator A and generator B, are trying to agree on a sequence of numbers. However, one of them is malfunctioning, and so the sequences don't always match.
As they do this, a judge waits for each of them to... | 35.577381 | 331 | 0.752886 |
factor_A = 16807
factor_B = 48271
divider = 2147483647
test_start_value_A = 65
test_start_value_B = 8921
input_A = 116
input_B = 299
def generator(start_value, factor):
val = start_value
while True:
val = val * factor % divider
yield val
def compare(start_A, start_B, rounds):
matches ... | true | true |
1c4507651df4cfeb751a19ff84991c40d5064f9e | 1,553 | py | Python | python/asdl/rust/__main__.py | DuckLogic/rust-asdlr | e900640f1973f334e30746d7f1caceff703662a7 | [
"MIT"
] | null | null | null | python/asdl/rust/__main__.py | DuckLogic/rust-asdlr | e900640f1973f334e30746d7f1caceff703662a7 | [
"MIT"
] | 2 | 2022-01-10T02:18:07.000Z | 2022-01-10T06:41:02.000Z | python/asdl/rust/__main__.py | DuckLogic/rust-astlib | e900640f1973f334e30746d7f1caceff703662a7 | [
"MIT"
] | null | null | null | from pathlib import Path
import click
import asdl
from . import GeneratorMode, write_source, AUTOGEN_MESSAGE
@click.command()
@click.argument('input-filename')
@click.option('--rust-file', '-R', 'rust_filename', type=click.Path(), required=True)
@click.option('--dump-module', '-D', is_flag=True)
@click.option(
'... | 32.354167 | 85 | 0.660657 | from pathlib import Path
import click
import asdl
from . import GeneratorMode, write_source, AUTOGEN_MESSAGE
@click.command()
@click.argument('input-filename')
@click.option('--rust-file', '-R', 'rust_filename', type=click.Path(), required=True)
@click.option('--dump-module', '-D', is_flag=True)
@click.option(
'... | true | true |
1c4507b1e693bc14907ab2b1dfd524207e7fbaf4 | 1,076 | py | Python | scenarios/camerainseaport/src/list_all_camera.py | rdsea/HINC | 2e94321f2f31b4deff08d08a4c128b958a469a3f | [
"Apache-2.0"
] | 1 | 2021-05-18T13:03:47.000Z | 2021-05-18T13:03:47.000Z | scenarios/camerainseaport/src/list_all_camera.py | rdsea/HINC | 2e94321f2f31b4deff08d08a4c128b958a469a3f | [
"Apache-2.0"
] | 11 | 2020-07-16T03:17:28.000Z | 2022-02-12T03:05:48.000Z | scenarios/camerainseaport/src/list_all_camera.py | rdsea/HINC | 2e94321f2f31b4deff08d08a4c128b958a469a3f | [
"Apache-2.0"
] | 1 | 2018-04-13T07:45:28.000Z | 2018-04-13T07:45:28.000Z | import requests
import sys
import os
import json
import pycurl
from urllib.parse import urlparse
'''
This shows a simple example of dealing with protocol interoperability with camera.
1)A customer searches for cameras in a location
'''
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--provide... | 25.619048 | 116 | 0.749071 | import requests
import sys
import os
import json
import pycurl
from urllib.parse import urlparse
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--provider_url', default='http://localhost:3000/camera', help='URL of the IoT Camera Provider')
parser.add_argument('--lon', default='108.1494449', he... | true | true |
1c4507d2f3b8880e6d7d9479a647f9a24833791f | 6,797 | py | Python | h1/model/storage_object.py | hyperonecom/h1-client-python | 4ce355852ba3120ec1b8f509ab5894a5c08da730 | [
"MIT"
] | null | null | null | h1/model/storage_object.py | hyperonecom/h1-client-python | 4ce355852ba3120ec1b8f509ab5894a5c08da730 | [
"MIT"
] | null | null | null | h1/model/storage_object.py | hyperonecom/h1-client-python | 4ce355852ba3120ec1b8f509ab5894a5c08da730 | [
"MIT"
] | null | null | null | """
HyperOne
HyperOne API # noqa: E501
The version of the OpenAPI document: 0.1.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from h1.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
... | 38.619318 | 110 | 0.571281 |
import re
import sys
from h1.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
class Storage... | true | true |
1c450927f120af0dc58091790586492d57fafa7d | 29,753 | py | Python | lobot.py | mrschue/lobot | d4e55d6086b2546709190f2e377e83bced58d004 | [
"MIT"
] | 2 | 2019-03-16T15:32:51.000Z | 2019-03-20T12:54:03.000Z | lobot.py | mrschue/lobot | d4e55d6086b2546709190f2e377e83bced58d004 | [
"MIT"
] | 2 | 2020-09-27T17:07:01.000Z | 2020-09-27T18:12:48.000Z | lobot.py | mrschue/lobot | d4e55d6086b2546709190f2e377e83bced58d004 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import json
from PyInquirer import style_from_dict, prompt
from prettytable import PrettyTable
import os
import subprocess
import boto3
from botocore.exceptions import ClientError
import datetime
import time
import socket
GLOBAL_CONFIG = {}
# Global dictionary that maps AWS-usernames to a descript... | 44.674174 | 240 | 0.618828 |
import json
from PyInquirer import style_from_dict, prompt
from prettytable import PrettyTable
import os
import subprocess
import boto3
from botocore.exceptions import ClientError
import datetime
import time
import socket
GLOBAL_CONFIG = {}
USERNAME_TO_AMI = {"ec2-user": "For Amazon Linux AMI, Fedora AMI, Suse AMI... | true | true |
1c45093a445be08922386a784e09521a402ff9a8 | 1,191 | py | Python | IPython/terminal/tests/test_help.py | chebee7i/ipython | 85b169fa3afc3d374973295c7f1409ededddbaca | [
"BSD-3-Clause-Clear"
] | 26 | 2018-02-14T23:52:58.000Z | 2021-08-16T13:50:03.000Z | IPython/terminal/tests/test_help.py | chebee7i/ipython | 85b169fa3afc3d374973295c7f1409ededddbaca | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/terminal/tests/test_help.py | chebee7i/ipython | 85b169fa3afc3d374973295c7f1409ededddbaca | [
"BSD-3-Clause-Clear"
] | 10 | 2018-08-13T19:38:39.000Z | 2020-04-19T03:02:00.000Z | """Test help output of various IPython entry points"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software... | 31.342105 | 78 | 0.455919 |
import IPython.testing.tools as tt
def test_ipython_help():
tt.help_all_output_test()
def test_profile_help():
tt.help_all_output_test("profile")
def test_profile_list_help():
tt.help_all_output_test("profile list")
def test_profile_create_help():
tt.help_all_output_test("profile cr... | true | true |
1c4509e4ca560671d16f2a9bb8671aab3ebd9e45 | 696 | py | Python | BOJ/03000~03999/3100~3199/3154.py | shinkeonkim/today-ps | f3e5e38c5215f19579bb0422f303a9c18c626afa | [
"Apache-2.0"
] | 2 | 2020-01-29T06:54:41.000Z | 2021-11-07T13:23:27.000Z | BOJ/03000~03999/3100~3199/3154.py | shinkeonkim/Today_PS | bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44 | [
"Apache-2.0"
] | null | null | null | BOJ/03000~03999/3100~3199/3154.py | shinkeonkim/Today_PS | bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44 | [
"Apache-2.0"
] | null | null | null | def f(a, b):
L = [[3,1],[0,0],[0,1],[0,2],[1,0],[1,1],[1,2],[2,0],[2,1],[2,2]]
return abs(L[a][0] - L[b][0]) + abs(L[a][1] - L[b][1])
M = list(map(int,input().split(":")))
C = 111111
ans = ""
for i in range(-3,10):
for j in range(-3,10):
h = (M[0] + 24*i)
m = (M[1] + 60*j)
... | 25.777778 | 69 | 0.360632 | def f(a, b):
L = [[3,1],[0,0],[0,1],[0,2],[1,0],[1,1],[1,2],[2,0],[2,1],[2,2]]
return abs(L[a][0] - L[b][0]) + abs(L[a][1] - L[b][1])
M = list(map(int,input().split(":")))
C = 111111
ans = ""
for i in range(-3,10):
for j in range(-3,10):
h = (M[0] + 24*i)
m = (M[1] + 60*j)
... | true | true |
1c450b5dfde3363bf54ac0a21e4761a8d8692d5c | 238 | py | Python | 5_kyu/product_of_consecutive_fib_numbers.py | nik4nd/codewars | efae95f1f9fbd5f31fc62b1b4f5a7d1ee511ced0 | [
"MIT"
] | null | null | null | 5_kyu/product_of_consecutive_fib_numbers.py | nik4nd/codewars | efae95f1f9fbd5f31fc62b1b4f5a7d1ee511ced0 | [
"MIT"
] | null | null | null | 5_kyu/product_of_consecutive_fib_numbers.py | nik4nd/codewars | efae95f1f9fbd5f31fc62b1b4f5a7d1ee511ced0 | [
"MIT"
] | null | null | null | def productFib(prod):
fib = [0, 1]
while fib[-1] * fib[-2] < prod:
fib.append(fib[-1] + fib[-2])
if fib[-1] * fib[-2] == prod:
return [fib[-2], fib[-1], True]
else:
return [fib[-2], fib[-1], False]
| 26.444444 | 40 | 0.466387 | def productFib(prod):
fib = [0, 1]
while fib[-1] * fib[-2] < prod:
fib.append(fib[-1] + fib[-2])
if fib[-1] * fib[-2] == prod:
return [fib[-2], fib[-1], True]
else:
return [fib[-2], fib[-1], False]
| true | true |
1c450b7bb090a0fc1273a64843f8c0d46cc1f084 | 1,080 | py | Python | var/spack/repos/builtin/packages/hazelcast/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/hazelcast/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/hazelcast/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Hazelcast(MavenPackage):
"""Hazelcast is an open-source distributed in-memory data
store and computation p... | 49.090909 | 96 | 0.773148 |
class Hazelcast(MavenPackage):
homepage = "http://www.hazelcast.com/"
url = "https://github.com/hazelcast/hazelcast/archive/v3.12.8.tar.gz"
version('4.0.2', sha256='4f01682583ae6603365ac7a24c568d7598cc3c1cbd736e5c6ed98bd75e39ffa3')
version('4.0.1', sha256='c9c7d5cbcf70c5e1eb72890df2b4104639... | true | true |
1c450c4040159fc28c9e4f9f9a5503948dc55c72 | 10,445 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/windows/win_scheduled_task_stat.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/windows/win_scheduled_task_stat.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/modules/windows/win_scheduled_task_stat.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 27.486842 | 92 | 0.629009 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: win_scheduled_task_stat
version_added: "2.5"
short_description: Get information about Windows Scheduled Tasks
description:
- Will return w... | true | true |
1c450c6fcbe3b62b2247c2fb25a8112f6abca6f6 | 60,369 | py | Python | Lib/optparse.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 52,316 | 2015-01-01T15:56:25.000Z | 2022-03-31T23:19:01.000Z | Lib/optparse.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 25,286 | 2015-03-03T23:18:02.000Z | 2022-03-31T23:17:27.000Z | Lib/optparse.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 31,623 | 2015-01-01T13:29:37.000Z | 2022-03-31T19:55:06.000Z | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionParser
pa... | 35.891201 | 79 | 0.582633 |
__version__ = "1.5.3"
__all__ = ['Option',
'make_option',
'SUPPRESS_HELP',
'SUPPRESS_USAGE',
'Values',
'OptionContainer',
'OptionGroup',
'OptionParser',
'HelpFormatter',
'IndentedHelpFormatter',
'TitledHelpFo... | true | true |
1c450d522f192a94ed707858331d204858a968c7 | 10,430 | py | Python | frappe/email/email_body.py | omirajkar/vmsfrappe | da65f47850944ea234fda0ca390bacb9dac39336 | [
"MIT"
] | 1 | 2020-01-14T17:06:07.000Z | 2020-01-14T17:06:07.000Z | frappe/email/email_body.py | omirajkar/vmsfrappe | da65f47850944ea234fda0ca390bacb9dac39336 | [
"MIT"
] | null | null | null | frappe/email/email_body.py | omirajkar/vmsfrappe | da65f47850944ea234fda0ca390bacb9dac39336 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, re
from frappe.utils.pdf import get_pdf
from frappe.email.smtp import get_outgoing_email_account
from frappe.utils import (get_url, scrub_urls, strip, expand_relati... | 33.754045 | 139 | 0.727229 |
from __future__ import unicode_literals
import frappe, re
from frappe.utils.pdf import get_pdf
from frappe.email.smtp import get_outgoing_email_account
from frappe.utils import (get_url, scrub_urls, strip, expand_relative_urls, cint,
split_emails, to_markdown, markdown, encode, random_string, parse_addr)
import ema... | true | true |
1c450d8cf947536398acc4c04ba15817d15671ab | 2,418 | py | Python | hummingbot/connector/exchange/huobi/huobi_utils.py | cardosofede/hummingbot | d1df085bb879a06a7dc77d4fdc8ff6f13d8726ca | [
"Apache-2.0"
] | 542 | 2021-12-17T22:34:31.000Z | 2022-03-31T14:36:23.000Z | hummingbot/connector/exchange/huobi/huobi_utils.py | cardosofede/hummingbot | d1df085bb879a06a7dc77d4fdc8ff6f13d8726ca | [
"Apache-2.0"
] | 291 | 2021-12-17T20:07:53.000Z | 2022-03-31T11:07:23.000Z | hummingbot/connector/exchange/huobi/huobi_utils.py | cardosofede/hummingbot | d1df085bb879a06a7dc77d4fdc8ff6f13d8726ca | [
"Apache-2.0"
] | 220 | 2021-12-17T12:41:23.000Z | 2022-03-31T23:03:22.000Z | import re
from decimal import Decimal
from typing import Optional, Tuple
from hummingbot.client.config.config_methods import using_exchange
from hummingbot.client.config.config_var import ConfigVar
from hummingbot.connector.exchange.huobi.huobi_ws_post_processor import HuobiWSPostProcessor
from hummingbot.core.data_ty... | 33.123288 | 92 | 0.698511 | import re
from decimal import Decimal
from typing import Optional, Tuple
from hummingbot.client.config.config_methods import using_exchange
from hummingbot.client.config.config_var import ConfigVar
from hummingbot.connector.exchange.huobi.huobi_ws_post_processor import HuobiWSPostProcessor
from hummingbot.core.data_ty... | true | true |
1c450ed72a7fafccbd98ee6d00b861adbfb2e6c6 | 1,681 | py | Python | src/django_pg_hll/bulk_update.py | M1ha-Shvn/django-pg-hll | 2530f63c95e02410c710b31b8a34470fbc06fa88 | [
"BSD-3-Clause"
] | 2 | 2020-09-08T10:10:39.000Z | 2021-06-08T19:16:51.000Z | src/django_pg_hll/bulk_update.py | M1ha-Shvn/django-pg-hll | 2530f63c95e02410c710b31b8a34470fbc06fa88 | [
"BSD-3-Clause"
] | 4 | 2020-09-08T13:53:27.000Z | 2021-11-05T14:17:40.000Z | src/django_pg_hll/bulk_update.py | M1hacka/django-pg-hll | 2530f63c95e02410c710b31b8a34470fbc06fa88 | [
"BSD-3-Clause"
] | 1 | 2020-09-07T15:35:22.000Z | 2020-09-07T15:35:22.000Z | """
django-pg-bulk-update support.
"""
from django.db.models.sql import Query
from .compatibility import django_pg_bulk_update_available
from .fields import HllField
from .values import HllEmpty, HllValue, HllCombinedExpression
# As django-pg-bulk-update library is not required, import only if it exists
if django_pg... | 36.543478 | 113 | 0.700178 |
from django.db.models.sql import Query
from .compatibility import django_pg_bulk_update_available
from .fields import HllField
from .values import HllEmpty, HllValue, HllCombinedExpression
if django_pg_bulk_update_available():
from django_pg_bulk_update.set_functions import ConcatSetFunction
from django_pg_... | true | true |
1c450f4f0df5c3af0c2e624475ff2ba3c604f2e3 | 5,208 | py | Python | qsimov/connectors/parser.py | daviddavo/QSimov | 2df523e911374553c6fa9caf2b895fd62bc46eed | [
"MIT"
] | null | null | null | qsimov/connectors/parser.py | daviddavo/QSimov | 2df523e911374553c6fa9caf2b895fd62bc46eed | [
"MIT"
] | null | null | null | qsimov/connectors/parser.py | daviddavo/QSimov | 2df523e911374553c6fa9caf2b895fd62bc46eed | [
"MIT"
] | null | null | null | """Module with gate name parsing stuff.
This module has all name parsing stuff
"""
import numpy as np
import re
__rep__ = re.compile(r"^([a-zA-Z0-9]+)" +
r"(\((?:(?:(?:[a-zA-Z]+)|" +
r"(?:[\+\-]?[0-9]+(?:\.[0-9]+)?(?:e[\+\-][0-9]+)?))" +
r"\,\s*)*(?:(?:(... | 34.039216 | 78 | 0.460061 |
import numpy as np
import re
__rep__ = re.compile(r"^([a-zA-Z0-9]+)" +
r"(\((?:(?:(?:[a-zA-Z]+)|" +
r"(?:[\+\-]?[0-9]+(?:\.[0-9]+)?(?:e[\+\-][0-9]+)?))" +
r"\,\s*)*(?:(?:(?:[a-zA-Z]+)|" +
r"(?:[\+\-]?[0-9]+(?:\.[0-9]+)?" +
... | true | true |
1c45101cb058c0ae07cfe74d84621ac3871e7f5e | 1,502 | py | Python | setup.py | ivanfmartinez/pysonofflan | 60d3f2ab2952207552c1e1ea3ebd796d984e427c | [
"MIT"
] | null | null | null | setup.py | ivanfmartinez/pysonofflan | 60d3f2ab2952207552c1e1ea3ebd796d984e427c | [
"MIT"
] | null | null | null | setup.py | ivanfmartinez/pysonofflan | 60d3f2ab2952207552c1e1ea3ebd796d984e427c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['Click>=7.0', 'click_log', 'websocket... | 29.45098 | 70 | 0.643142 |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['Click>=7.0', 'click_log', 'websockets']
setup_requirements = []
test_requirements = ['pytest', 'tox', 'p... | true | true |
1c451056684517a5a35b4eeda9fafd24b1138137 | 6,010 | py | Python | tob-api/api/indy/agent.py | mehmetaydar/TheOrgBook | 951fcdbc45d2b8f7f3a7887aac19c7f04b70e23a | [
"Apache-2.0"
] | 1 | 2021-02-23T14:15:42.000Z | 2021-02-23T14:15:42.000Z | tob-api/api/indy/agent.py | mehmetaydar/TheOrgBook | 951fcdbc45d2b8f7f3a7887aac19c7f04b70e23a | [
"Apache-2.0"
] | null | null | null | tob-api/api/indy/agent.py | mehmetaydar/TheOrgBook | 951fcdbc45d2b8f7f3a7887aac19c7f04b70e23a | [
"Apache-2.0"
] | null | null | null | import os
import threading
from von_agent.nodepool import NodePool
from von_agent.wallet import Wallet
from tob_api import hyperledger_indy
from von_agent.agents import Issuer as VonIssuer
from von_agent.agents import Verifier as VonVerifier
from von_agent.agents import HolderProver as VonHolderProver
from typing impo... | 34.94186 | 131 | 0.620632 | import os
import threading
from von_agent.nodepool import NodePool
from von_agent.wallet import Wallet
from tob_api import hyperledger_indy
from von_agent.agents import Issuer as VonIssuer
from von_agent.agents import Verifier as VonVerifier
from von_agent.agents import HolderProver as VonHolderProver
from typing impo... | true | true |
1c45137fe7f938199493e48688d1b72f051eeb5e | 821 | py | Python | toTheMoon/offer66_4_SearchInTwoDimensionalArray.py | jercas/offer66-leetcode-newcode | a2e5256f27dbfb23fc34119fc857cd9b00e28c03 | [
"MIT"
] | null | null | null | toTheMoon/offer66_4_SearchInTwoDimensionalArray.py | jercas/offer66-leetcode-newcode | a2e5256f27dbfb23fc34119fc857cd9b00e28c03 | [
"MIT"
] | null | null | null | toTheMoon/offer66_4_SearchInTwoDimensionalArray.py | jercas/offer66-leetcode-newcode | a2e5256f27dbfb23fc34119fc857cd9b00e28c03 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 26 10:47:52 2019
@author: jercas
"""
"""
offer66-4
'二维数组中的查找'
在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,
每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
"""
class Solution:
# array 二维列表
def Find(self, target, array):
if len(array[0]) == 0:
return False
... | 20.525 | 78 | 0.595615 |
class Solution:
def Find(self, target, array):
if len(array[0]) == 0:
return False
n = len(array)
row, col = 0, n - 1
while row < n and col >= 0:
if array[row][col] == target:
return True
elif array[row][col] > target:
col -= 1
else:
row += 1
return False
if __name__ == "... | true | true |
1c4513e8f055ddeb4859242b1de268020ecb30ae | 563 | py | Python | examples/mnist/utils.py | gfrogat/prunhild | 55769c6f2eca2748288c24826dd3bb14deaf5707 | [
"MIT"
] | 28 | 2019-05-07T03:27:30.000Z | 2022-02-02T19:49:12.000Z | examples/mnist/utils.py | gfrogat/prunhild | 55769c6f2eca2748288c24826dd3bb14deaf5707 | [
"MIT"
] | null | null | null | examples/mnist/utils.py | gfrogat/prunhild | 55769c6f2eca2748288c24826dd3bb14deaf5707 | [
"MIT"
] | 5 | 2019-05-14T00:21:15.000Z | 2021-11-25T13:26:44.000Z | def get_parameter_stats(model):
n_zero = 0.0
n_total = 0.0
for param in model.parameters():
# assume values smaller than 1e-7 (for 32bit) to be zero
n_zero += param.data.abs().le(1e-7).sum().item()
n_total += param.data.numel()
ratio_zero = n_zero / n_total
return n_zero, n_... | 28.15 | 64 | 0.614565 | def get_parameter_stats(model):
n_zero = 0.0
n_total = 0.0
for param in model.parameters():
n_zero += param.data.abs().le(1e-7).sum().item()
n_total += param.data.numel()
ratio_zero = n_zero / n_total
return n_zero, n_total, ratio_zero
def print_parameter_stats(parameter_... | true | true |
1c4517f681dbd5414de6d4df269356db3a4b654d | 7,253 | py | Python | tensorflow/python/debug/lib/source_remote_test.py | harunpehlivan/tensorflow | 376e2cfdab31f4da251ea2e50992a9bf97fd171b | [
"Apache-2.0"
] | 16 | 2018-01-30T22:16:13.000Z | 2021-07-18T10:00:55.000Z | tensorflow/python/debug/lib/source_remote_test.py | harunpehlivan/tensorflow | 376e2cfdab31f4da251ea2e50992a9bf97fd171b | [
"Apache-2.0"
] | 3 | 2018-05-09T11:31:58.000Z | 2021-01-27T12:26:21.000Z | tensorflow/python/debug/lib/source_remote_test.py | harunpehlivan/tensorflow | 376e2cfdab31f4da251ea2e50992a9bf97fd171b | [
"Apache-2.0"
] | 13 | 2018-02-22T21:04:13.000Z | 2020-11-17T11:38:36.000Z | # Copyright 2017 The TensorFlow Authors. 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 applica... | 42.168605 | 88 | 0.724252 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import traceback
from tensorflow.core.debug import debug_service_pb2
from tensorflow.python.client import session
from tensorflow.python.debug.lib import grpc_debug_test_server
from te... | true | true |
1c4519051ae3887019459e07c09bc75536f88eb7 | 8,570 | py | Python | fastreid/config/defaults.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | 1 | 2020-12-24T09:32:21.000Z | 2020-12-24T09:32:21.000Z | fastreid/config/defaults.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | null | null | null | fastreid/config/defaults.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | null | null | null | from .config import CfgNode as CN
# -----------------------------------------------------------------------------
# Convention about Training / Test specific parameters
# -----------------------------------------------------------------------------
# Whenever an argument can be either used for training or for testing,... | 31.277372 | 102 | 0.592065 | from .config import CfgNode as CN
_C = CN()
_C.MODEL = CN()
_C.MODEL.DEVICE = "cuda"
_C.MODEL.META_ARCHITECTURE = 'Baseline'
_C.MODEL.FREEZE_LAYERS = ['']
_C.MODEL.BACKBONE = CN()
_C.MODEL.BACKBONE.NAME = "build_resnet_backbone"
_C.MODEL.BACKBONE.DEPTH = "50x"
_C.MODEL.BACKBONE.LAST_STRIDE = 1
_C... | true | true |
1c45191232e6f107bedf746641c84c6c18d003d0 | 13,305 | py | Python | CGATPipelines/Pipeline/Cluster.py | cdrakesmith/CGATPipelines | 3c94ae4f9d87d51108255dc405c4b95af7c8b694 | [
"MIT"
] | null | null | null | CGATPipelines/Pipeline/Cluster.py | cdrakesmith/CGATPipelines | 3c94ae4f9d87d51108255dc405c4b95af7c8b694 | [
"MIT"
] | null | null | null | CGATPipelines/Pipeline/Cluster.py | cdrakesmith/CGATPipelines | 3c94ae4f9d87d51108255dc405c4b95af7c8b694 | [
"MIT"
] | null | null | null | '''Cluster.py - cluster utility functions for ruffus pipelines
==============================================================
This module abstracts the DRMAA native specification and provides
convenience functions for running Drmaa jobs.
Reference
---------
'''
import re
import os
import stat
import time
import CG... | 34.115385 | 96 | 0.583991 |
import re
import os
import stat
import time
import CGAT.Experiment as E
try:
import drmaa
HAS_DRMAA = True
except (ImportError, RuntimeError):
HAS_DRMAA = False
def setupDrmaaJobTemplate(drmaa_session, options, job_name, job_memory):
if not job_memory:
raise ValueError("Job memory must be... | true | true |
1c451a8e590f9ec729b1bc20c53b683a1db7a13e | 1,503 | py | Python | src/OTLMOW/OTLModel/Datatypes/KlVerlichtingstoestelconnectorBesturingsconnector.py | davidvlaminck/OTLClassPython | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | 2 | 2022-02-01T08:58:11.000Z | 2022-02-08T13:35:17.000Z | src/OTLMOW/OTLModel/Datatypes/KlVerlichtingstoestelconnectorBesturingsconnector.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | src/OTLMOW/OTLModel/Datatypes/KlVerlichtingstoestelconnectorBesturingsconnector.py | davidvlaminck/OTLMOW | 71330afeb37c3ea6d9981f521ff8f4a3f8b946fc | [
"MIT"
] | null | null | null | # coding=utf-8
from OTLMOW.OTLModel.Datatypes.KeuzelijstField import KeuzelijstField
from OTLMOW.OTLModel.Datatypes.KeuzelijstWaarde import KeuzelijstWaarde
# Generated with OTLEnumerationCreator. To modify: extend, do not edit
class KlVerlichtingstoestelconnectorBesturingsconnector(KeuzelijstField):
"""Type van ... | 65.347826 | 168 | 0.743846 |
from OTLMOW.OTLModel.Datatypes.KeuzelijstField import KeuzelijstField
from OTLMOW.OTLModel.Datatypes.KeuzelijstWaarde import KeuzelijstWaarde
class KlVerlichtingstoestelconnectorBesturingsconnector(KeuzelijstField):
naam = 'KlVerlichtingstoestelconnectorBesturingsconnector'
label = 'WV-besturingsconnector'
... | true | true |
1c451acb8ba967675446c6c9dcd9a6f243d7c450 | 1,913 | py | Python | experiments/comparison/baseline_search.py | alcinos/auto_yolo | 78727596f937b38d4de47dd9f0a7cc8c6104323f | [
"MIT"
] | 54 | 2018-12-10T21:08:42.000Z | 2022-02-18T02:44:19.000Z | experiments/comparison/baseline_search.py | alcinos/auto_yolo | 78727596f937b38d4de47dd9f0a7cc8c6104323f | [
"MIT"
] | 8 | 2019-04-02T10:31:13.000Z | 2022-03-31T13:44:25.000Z | experiments/comparison/baseline_search.py | alcinos/auto_yolo | 78727596f937b38d4de47dd9f0a7cc8c6104323f | [
"MIT"
] | 16 | 2019-04-26T11:45:08.000Z | 2022-02-09T07:59:25.000Z | from auto_yolo import envs
import argparse
import numpy as np
readme = "Searching for baseline threshold."
parser = argparse.ArgumentParser()
parser.add_argument("--n-digits", type=int, default=1)
parser.add_argument("--transfer", action="store_true")
parser.add_argument("--sc", choices="AP count_error count_1norm".... | 27.724638 | 95 | 0.68322 | from auto_yolo import envs
import argparse
import numpy as np
readme = "Searching for baseline threshold."
parser = argparse.ArgumentParser()
parser.add_argument("--n-digits", type=int, default=1)
parser.add_argument("--transfer", action="store_true")
parser.add_argument("--sc", choices="AP count_error count_1norm".... | true | true |
1c451ace7c8c4a9840e36df73ca94d6221a26439 | 5,729 | py | Python | test/client/dev_server.py | GeekLiB/unrealcv | 9acfcb5b52c5b085e72e64a0bb46ea4d0adadcdb | [
"MIT"
] | 1 | 2020-06-29T02:33:44.000Z | 2020-06-29T02:33:44.000Z | test/client/dev_server.py | GeekLiB/unrealcv | 9acfcb5b52c5b085e72e64a0bb46ea4d0adadcdb | [
"MIT"
] | null | null | null | test/client/dev_server.py | GeekLiB/unrealcv | 9acfcb5b52c5b085e72e64a0bb46ea4d0adadcdb | [
"MIT"
] | 4 | 2017-03-23T14:52:22.000Z | 2020-06-29T02:33:54.000Z | '''
A python server to mimic the behavior of unrealcv server
Useful for development
'''
import threading, logging, sys
if (sys.version_info > (3, 0)):
import socketserver as SocketServer
else:
import SocketServer
# import MySocketServer as SocketServer
SocketServer.ThreadingMixIn.daemon_threads = True
SocketSer... | 36.259494 | 109 | 0.653168 | import threading, logging, sys
if (sys.version_info > (3, 0)):
import socketserver as SocketServer
else:
import SocketServer
SocketServer.ThreadingMixIn.daemon_threads = True
SocketServer.TCPServer.allow_reuse_address = True
import unrealcv
_L = logging.getLogger(__name__)
_L.setLevel(logging.INFO)
_L.addHan... | true | true |
1c451be187ab0f02d6d4a30d729c850021a93b2f | 598 | py | Python | bdaydict.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | bdaydict.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | bdaydict.py | rayjustinhuang/BitesofPy | 03b694c5259ff607621419d9677c5caff90a6057 | [
"MIT"
] | null | null | null | from datetime import date
MSG = 'Hey {}, there are more people with your birthday!'
class BirthdayDict(dict):
"""Override dict to print a message every time a new person is added that has
the same birthday (day+month) as somebody already in the dict"""
def __init__(self, *args, **kwargs):
sel... | 33.222222 | 81 | 0.64214 | from datetime import date
MSG = 'Hey {}, there are more people with your birthday!'
class BirthdayDict(dict):
def __init__(self, *args, **kwargs):
self.update(*args, **kwargs)
def __setitem__(self, name, birthday):
for date in self.values():
if birthday.day == date.day and birth... | true | true |
1c451c467f4bd7d3914dcec4205aa7681ffb50f0 | 11,533 | py | Python | datasets/nclt.py | XiaoyongNI/hybrid-inference | c268e1ada019e08f62e3f02fc6d5059130ec5358 | [
"MIT"
] | 16 | 2019-11-22T15:40:32.000Z | 2022-03-14T14:39:01.000Z | datasets/nclt.py | XiaoyongNI/hybrid-inference | c268e1ada019e08f62e3f02fc6d5059130ec5358 | [
"MIT"
] | 2 | 2020-02-11T13:36:56.000Z | 2020-05-18T15:58:21.000Z | datasets/nclt.py | XiaoyongNI/hybrid-inference | c268e1ada019e08f62e3f02fc6d5059130ec5358 | [
"MIT"
] | 4 | 2020-02-04T16:36:31.000Z | 2021-11-25T07:26:46.000Z | from __future__ import print_function
import sys, os
sys.path.append('../')
import torch.utils.data as data
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import torch
import pickle
import settings
import time
dates = [];
dates.append('2012-01-08')
dates.append('2012-01-15')
dates.append('2012-0... | 32.764205 | 123 | 0.562213 | from __future__ import print_function
import sys, os
sys.path.append('../')
import torch.utils.data as data
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import torch
import pickle
import settings
import time
dates = [];
dates.append('2012-01-08')
dates.append('2012-01-15')
dates.append('2012-0... | true | true |
1c451cce6b7f3b495ac9f7b0e576b3407cde8ba6 | 719 | py | Python | lemon/libs/route.py | InsaneMiner/Salt | b61c5f931fe4b6fa652e8fbfb59b30dbaaf9ed18 | [
"MIT"
] | 6 | 2020-11-22T11:42:55.000Z | 2022-01-09T12:29:30.000Z | lemon/libs/route.py | InsaneMiner/Salt | b61c5f931fe4b6fa652e8fbfb59b30dbaaf9ed18 | [
"MIT"
] | 1 | 2020-11-21T00:05:40.000Z | 2020-11-22T21:58:54.000Z | lemon/libs/route.py | InsaneMiner/Salt | b61c5f931fe4b6fa652e8fbfb59b30dbaaf9ed18 | [
"MIT"
] | 2 | 2021-06-05T04:19:04.000Z | 2021-06-05T04:28:08.000Z | import app.web
import config.config
import lemon.libs.lemon
import lemon.libs.colors
import lemon.libs.url_validation
import app.urls
def page(object):
correct_url = lemon.libs.url_validation.validate_url(object.url,app.urls.urls)
if correct_url[0] != None:
try:
object.url_data = correct_u... | 29.958333 | 82 | 0.632823 | import app.web
import config.config
import lemon.libs.lemon
import lemon.libs.colors
import lemon.libs.url_validation
import app.urls
def page(object):
correct_url = lemon.libs.url_validation.validate_url(object.url,app.urls.urls)
if correct_url[0] != None:
try:
object.url_data = correct_u... | true | true |
1c451da618026b8bebb5ad5310a8825f0a00e52b | 3,724 | py | Python | osdu/services/search.py | eternelpanic/osdupy | 3b30ceaed7f7f333a6a41d542b9430d4042f77f2 | [
"MIT"
] | null | null | null | osdu/services/search.py | eternelpanic/osdupy | 3b30ceaed7f7f333a6a41d542b9430d4042f77f2 | [
"MIT"
] | 7 | 2020-09-24T03:54:34.000Z | 2022-03-29T20:16:42.000Z | osdu/services/search.py | eternelpanic/osdupy | 3b30ceaed7f7f333a6a41d542b9430d4042f77f2 | [
"MIT"
] | 3 | 2021-03-10T20:51:50.000Z | 2021-09-30T08:31:45.000Z | """ Provides a simple Python interface to the OSDU Search API.
"""
import requests
from .base import BaseService
class SearchService(BaseService):
def __init__(self, client):
super().__init__(client, 'search', service_version=2)
def query(self, query: dict) -> dict:
"""Executes a query again... | 51.722222 | 114 | 0.59855 | import requests
from .base import BaseService
class SearchService(BaseService):
def __init__(self, client):
super().__init__(client, 'search', service_version=2)
def query(self, query: dict) -> dict:
url = f'{self._service_url}/query'
response = requests.post(url=url, headers=self._h... | true | true |
1c451da9965b9c22319a97ee2b115df66aa1b1c4 | 8,190 | py | Python | Gladiator/Player.py | sergenp/gladoidbot | 6e450d8b379e2c8238e4cf32b3d71b2e13154034 | [
"MIT"
] | 1 | 2020-09-04T03:59:27.000Z | 2020-09-04T03:59:27.000Z | Gladiator/Player.py | sergenp/gladoidbot | 6e450d8b379e2c8238e4cf32b3d71b2e13154034 | [
"MIT"
] | null | null | null | Gladiator/Player.py | sergenp/gladoidbot | 6e450d8b379e2c8238e4cf32b3d71b2e13154034 | [
"MIT"
] | 1 | 2020-03-18T13:10:11.000Z | 2020-03-18T13:10:11.000Z | import random
import math
import json
from Gladiator.Stats.GladiatorStats import GladiatorStats
from Gladiator.AttackInformation.GladiatorAttackInformation import GladiatorAttackInformation
from Gladiator.Equipments.GladiatorEquipments import GladiatorEquipments
import urllib.parse
import pathlib
path = pathlib.Path(__... | 39.186603 | 159 | 0.617582 | import random
import math
import json
from Gladiator.Stats.GladiatorStats import GladiatorStats
from Gladiator.AttackInformation.GladiatorAttackInformation import GladiatorAttackInformation
from Gladiator.Equipments.GladiatorEquipments import GladiatorEquipments
import urllib.parse
import pathlib
path = pathlib.Path(__... | true | true |
1c451e591138c58b97abd21b494bd67e7590cc57 | 457 | py | Python | 1143-longest-common-subsequence/1143-longest-common-subsequence.py | tlylt/LeetCodeAnki | 9f69504c3762f7895d95c2a592f18ad395199ff4 | [
"MIT"
] | 1 | 2022-02-14T08:03:32.000Z | 2022-02-14T08:03:32.000Z | 1143-longest-common-subsequence/1143-longest-common-subsequence.py | tlylt/LeetCodeAnki | 9f69504c3762f7895d95c2a592f18ad395199ff4 | [
"MIT"
] | null | null | null | 1143-longest-common-subsequence/1143-longest-common-subsequence.py | tlylt/LeetCodeAnki | 9f69504c3762f7895d95c2a592f18ad395199ff4 | [
"MIT"
] | null | null | null | class Solution:
def longestCommonSubsequence(self, text1: str, text2: str) -> int:
m = len(text1)
n = len(text2)
dp = [[0 for i in range(n+1)] for j in range(m+1)]
for i in range(1, m+1):
for j in range(1, n+1):
if text1[i-1] == text2[j-1]:
... | 38.083333 | 70 | 0.428884 | class Solution:
def longestCommonSubsequence(self, text1: str, text2: str) -> int:
m = len(text1)
n = len(text2)
dp = [[0 for i in range(n+1)] for j in range(m+1)]
for i in range(1, m+1):
for j in range(1, n+1):
if text1[i-1] == text2[j-1]:
... | true | true |
1c451ea06c8fd0d11137c3e4b9dda843e3fa5e7b | 44,232 | py | Python | python_modules/dagster/dagster/core/definitions/pipeline_definition.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/pipeline_definition.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/definitions/pipeline_definition.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from functools import update_wrapper
from typing import TYPE_CHECKING, AbstractSet, Any, Dict, FrozenSet, List, Optional, Set, Union
from dagster import check
from dagster.core.definitions.policy import RetryPolicy
from dagster.core.definitions.resource_definition import ResourceDefinition
from dagster.core.definition... | 41.03154 | 123 | 0.639107 | from functools import update_wrapper
from typing import TYPE_CHECKING, AbstractSet, Any, Dict, FrozenSet, List, Optional, Set, Union
from dagster import check
from dagster.core.definitions.policy import RetryPolicy
from dagster.core.definitions.resource_definition import ResourceDefinition
from dagster.core.definition... | true | true |
1c451f5fc59e92b0a8345779653aacf61ab487e0 | 4,150 | py | Python | tcconfig/_common.py | Mnkras/tcconfig | 2173ffc4fa4e23fa0a2b89c1185e9e44350d5aad | [
"MIT"
] | 1 | 2020-07-23T07:07:47.000Z | 2020-07-23T07:07:47.000Z | tcconfig/_common.py | RinaisSuper/tcconfig | d45efa64a589c6f0fb75059414bf629683b920dc | [
"MIT"
] | null | null | null | tcconfig/_common.py | RinaisSuper/tcconfig | d45efa64a589c6f0fb75059414bf629683b920dc | [
"MIT"
] | null | null | null | """
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
import contextlib
import errno
import os
import re
import sys
import msgfy
import subprocrunner as spr
import typepy
from humanreadable import ParameterError
from path import Path
from simplesqlite import SimpleSQLite
from ._const import IPV6_OP... | 26.948052 | 91 | 0.650602 |
import contextlib
import errno
import os
import re
import sys
import msgfy
import subprocrunner as spr
import typepy
from humanreadable import ParameterError
from path import Path
from simplesqlite import SimpleSQLite
from ._const import IPV6_OPTION_ERROR_MSG_FORMAT, TcCommandOutput
from ._logger import logger, set_... | true | true |
1c451fd9da10cf900c3dbc0db1934d2f21680917 | 11,336 | py | Python | sdk/lusid_drive/models/lusid_validation_problem_details.py | finbourne/drive-sdk-python-preview | 24d218e09c45efa378ba2e5b9da00a3b84258fa1 | [
"MIT"
] | null | null | null | sdk/lusid_drive/models/lusid_validation_problem_details.py | finbourne/drive-sdk-python-preview | 24d218e09c45efa378ba2e5b9da00a3b84258fa1 | [
"MIT"
] | null | null | null | sdk/lusid_drive/models/lusid_validation_problem_details.py | finbourne/drive-sdk-python-preview | 24d218e09c45efa378ba2e5b9da00a3b84258fa1 | [
"MIT"
] | 1 | 2021-03-01T02:27:02.000Z | 2021-03-01T02:27:02.000Z | # coding: utf-8
"""
FINBOURNE Drive API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.1.274
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec... | 28.411028 | 204 | 0.593772 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re
import six
from lusid_drive.configuration import Configuration
class LusidValidationProblemDetails(object):
openapi_types = {
'name': 'str',
'error_d... | true | true |
1c45209729e1d21c4b3a6f31d130e2310e6cba86 | 392 | py | Python | tests/test_entities/test_lead_source.py | stas12312/aioalfacrm | 1501634fa5ef4591936be2e6147827565e4a0b36 | [
"MIT"
] | null | null | null | tests/test_entities/test_lead_source.py | stas12312/aioalfacrm | 1501634fa5ef4591936be2e6147827565e4a0b36 | [
"MIT"
] | 49 | 2021-11-11T16:00:40.000Z | 2021-11-24T15:37:34.000Z | tests/test_entities/test_lead_source.py | stas12312/aioalfacrm | 1501634fa5ef4591936be2e6147827565e4a0b36 | [
"MIT"
] | null | null | null | from aioalfacrm.entities import LeadSource
def test_init_lead_source():
lead_source = LeadSource(
id=1,
code='123',
name='name',
is_enabled=True,
weight=1,
)
assert lead_source.id == 1
assert lead_source.code == '123'
assert lead_source.name == 'name'
a... | 21.777778 | 42 | 0.632653 | from aioalfacrm.entities import LeadSource
def test_init_lead_source():
lead_source = LeadSource(
id=1,
code='123',
name='name',
is_enabled=True,
weight=1,
)
assert lead_source.id == 1
assert lead_source.code == '123'
assert lead_source.name == 'name'
a... | true | true |
1c4521fc9177fa6a313e6d050feee3d74b820b75 | 877 | py | Python | Projetos-Python/Aula 4/Driver.py | gfjallais/Projetos-Python | 17e67dd020246c244dcd0c4891eefbc7f3fc7ed2 | [
"MIT"
] | null | null | null | Projetos-Python/Aula 4/Driver.py | gfjallais/Projetos-Python | 17e67dd020246c244dcd0c4891eefbc7f3fc7ed2 | [
"MIT"
] | null | null | null | Projetos-Python/Aula 4/Driver.py | gfjallais/Projetos-Python | 17e67dd020246c244dcd0c4891eefbc7f3fc7ed2 | [
"MIT"
] | null | null | null | import sys
import VPL_mSort
def test(case, args):
if case == 0:
print(VPL_mSort.ll2py(VPL_mSort.py2ll(args)))
elif case == 1:
print(VPL_mSort.size(VPL_mSort.py2ll(args)))
elif case == 2:
print(VPL_mSort.sorted(VPL_mSort.py2ll(args)))
elif case == 3:
print(VP... | 30.241379 | 71 | 0.59065 | import sys
import VPL_mSort
def test(case, args):
if case == 0:
print(VPL_mSort.ll2py(VPL_mSort.py2ll(args)))
elif case == 1:
print(VPL_mSort.size(VPL_mSort.py2ll(args)))
elif case == 2:
print(VPL_mSort.sorted(VPL_mSort.py2ll(args)))
elif case == 3:
print(VP... | true | true |
1c4522290fc38b60b333c6de255cbf07d0f9cc5a | 3,371 | py | Python | code/auto_download/auto-download-usc.py | altymis/covid19-forecast-hub-europe | 1a413439d0a4800356cfed8129ea943d14e37f8e | [
"MIT"
] | 31 | 2020-05-20T15:38:57.000Z | 2022-02-13T01:31:33.000Z | code/auto_download/auto-download-usc.py | altymis/covid19-forecast-hub-europe | 1a413439d0a4800356cfed8129ea943d14e37f8e | [
"MIT"
] | 777 | 2020-05-18T14:55:53.000Z | 2022-03-29T20:43:17.000Z | code/auto_download/auto-download-usc.py | altymis/covid19-forecast-hub-europe | 1a413439d0a4800356cfed8129ea943d14e37f8e | [
"MIT"
] | 65 | 2020-05-20T07:42:36.000Z | 2021-11-20T21:25:23.000Z | # Auto-download forecasts of Geneva-Team
# Jakob Ketterer, November 2020
import re
import os
import urllib.request
from dateutil.parser import parse
from datetime import datetime, timedelta
def get_filenames(date, root, format_str):
'''get available csv files for dir specified by root link and date'''
# open ... | 37.455556 | 127 | 0.652625 |
import re
import os
import urllib.request
from dateutil.parser import parse
from datetime import datetime, timedelta
def get_filenames(date, root, format_str):
dirpath = root + date
url = urllib.request.urlopen(dirpath)
str = url.read().decode('utf-8')
pattern = re.compile('/' + date + '/... | true | true |
1c45243b3347721b169c75fea7b987a1e3a1f73d | 79 | py | Python | Chapter5_module_package_program/Section5.3_module_and_import/weatherman.py | skatsuta/introducing-python | 945fc84ba58aaa2602e454890c8c6f26e403660e | [
"MIT"
] | null | null | null | Chapter5_module_package_program/Section5.3_module_and_import/weatherman.py | skatsuta/introducing-python | 945fc84ba58aaa2602e454890c8c6f26e403660e | [
"MIT"
] | null | null | null | Chapter5_module_package_program/Section5.3_module_and_import/weatherman.py | skatsuta/introducing-python | 945fc84ba58aaa2602e454890c8c6f26e403660e | [
"MIT"
] | null | null | null | import report
desc = report.get_description()
print("Today's weather:", desc)
| 15.8 | 31 | 0.746835 | import report
desc = report.get_description()
print("Today's weather:", desc)
| true | true |
1c4525585f1c8640b6f463f98969dc51236fc7ed | 2,259 | py | Python | esp32/tools/lora/actility/actility.py | nevercast/pycom-micropython-sigfox | d1c5ea900b94fb62890742b54fa0b249b93c9f96 | [
"MIT"
] | 1 | 2019-03-28T10:37:35.000Z | 2019-03-28T10:37:35.000Z | esp32/tools/lora/actility/actility.py | nevercast/pycom-micropython-sigfox | d1c5ea900b94fb62890742b54fa0b249b93c9f96 | [
"MIT"
] | null | null | null | esp32/tools/lora/actility/actility.py | nevercast/pycom-micropython-sigfox | d1c5ea900b94fb62890742b54fa0b249b93c9f96 | [
"MIT"
] | 1 | 2019-09-22T01:28:52.000Z | 2019-09-22T01:28:52.000Z | #!/usr/bin/env python
#
# Copyright (c) 2018, Pycom Limited.
#
# This software is licensed under the GNU GPL version 3 or any
# later version, with permitted additional terms. For more information
# see the Pycom Licence v1.0 document supplied with this file, or
# available at https://www.pycom.io/opensource/licensing
... | 33.220588 | 93 | 0.633023 |
from network import LoRa
from machine import ADC
import time
import binascii
import socket
import struct
DEV_EUI = '1A 2B 3C 4D 01 02 03'
APP_EUI = 'AD A4 DA E3 AC 12 67 6B'
APP_KEY = '11 B0 28 2A 18 9B 75 B0 B4 D2 D8 C7 FA 38 54 8B'
DEV_ADDR = '00 00 00 0A'
NWK_SWKEY = '2B 7E 15 16 28 AE D2 A6 AB F7 15 88... | true | true |
1c4526eff1ed90273050f64a4dd975e16e39aea8 | 7,835 | py | Python | airflow/providers/apache/kylin/operators/kylin_cube.py | DavisWang-LR/airflow | 60b10ef9248ec59fecaa7628c07c76950005a35d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/providers/apache/kylin/operators/kylin_cube.py | DavisWang-LR/airflow | 60b10ef9248ec59fecaa7628c07c76950005a35d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/providers/apache/kylin/operators/kylin_cube.py | DavisWang-LR/airflow | 60b10ef9248ec59fecaa7628c07c76950005a35d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.020942 | 105 | 0.657817 |
import time
from datetime import datetime
from typing import Optional
from kylinpy import kylinpy
from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.providers.apache.kylin.hooks.kylin import KylinHook
from airflow.utils import timezone
from airflow.u... | true | true |
1c4527dedfe7c3af42d455407bac0356cec37b01 | 937 | py | Python | tests/test_scraper.py | yasen-m/dosage | 81fe088621ad335cac2a53fcbc7b9b37f49ddce2 | [
"MIT"
] | null | null | null | tests/test_scraper.py | yasen-m/dosage | 81fe088621ad335cac2a53fcbc7b9b37f49ddce2 | [
"MIT"
] | null | null | null | tests/test_scraper.py | yasen-m/dosage | 81fe088621ad335cac2a53fcbc7b9b37f49ddce2 | [
"MIT"
] | null | null | null | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2013-2014 Bastian Kleineidam
from unittest import TestCase
from dosagelib import scraper
class ScraperTester(TestCase):
"""Test scraper module functions."""
def test_get_scraperclasses(self):
for scraperclass in scraper.get_scraperclasses():
sc... | 34.703704 | 72 | 0.692636 |
from unittest import TestCase
from dosagelib import scraper
class ScraperTester(TestCase):
def test_get_scraperclasses(self):
for scraperclass in scraper.get_scraperclasses():
scraperobj = scraperclass()
scraperobj = scraperclass(indexes=["bla"])
self.assertTrue(scra... | true | true |
1c4527ebc8a4e4ee7a6fe10a1481392fa1695e4a | 438 | py | Python | plotly/validators/contour/_ncontours.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/contour/_ncontours.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/contour/_ncontours.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class NcontoursValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name='ncontours', parent_name='contour', **kwargs
):
super(NcontoursValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | 25.764706 | 72 | 0.614155 | import _plotly_utils.basevalidators
class NcontoursValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name='ncontours', parent_name='contour', **kwargs
):
super(NcontoursValidator, self).__init__(
plotly_name=plotly_name,
parent_name=p... | true | true |
1c452813948fb86477b8078254ef466e67e018db | 29,372 | py | Python | notebook/home/.jupyter/jupyter_notebook_config.py | cj-lin/docker-hadoop-workbench | d2a74f28c4fd5cdcf38c080efae89edcfcf4d0b9 | [
"MIT"
] | null | null | null | notebook/home/.jupyter/jupyter_notebook_config.py | cj-lin/docker-hadoop-workbench | d2a74f28c4fd5cdcf38c080efae89edcfcf4d0b9 | [
"MIT"
] | null | null | null | notebook/home/.jupyter/jupyter_notebook_config.py | cj-lin/docker-hadoop-workbench | d2a74f28c4fd5cdcf38c080efae89edcfcf4d0b9 | [
"MIT"
] | null | null | null | # Configuration file for jupyter-notebook.
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging f... | 38.344648 | 103 | 0.703663 |
enabled, the token is added to the
# custom URL automatically.
#
# This option is intended to be used when the URL to display to the user cannot
# be determined reliably by the Jupyter notebook server (proxified or
# containerized setups for example).
#c.NotebookApp.custom_display_url = ''
## The default U... | true | true |
1c452a490eeb077cc003533ae2228ef6439afa07 | 150 | py | Python | cra_helper/context_processors.py | squidsoup/django-cra-helper | ba50c643c181a18b80ee9bbdbea74b58abd6daad | [
"MIT"
] | 54 | 2017-04-03T20:20:16.000Z | 2022-01-29T21:12:05.000Z | cra_helper/context_processors.py | squidsoup/django-cra-helper | ba50c643c181a18b80ee9bbdbea74b58abd6daad | [
"MIT"
] | 23 | 2018-07-19T13:19:35.000Z | 2021-09-22T19:25:39.000Z | cra_helper/context_processors.py | squidsoup/django-cra-helper | ba50c643c181a18b80ee9bbdbea74b58abd6daad | [
"MIT"
] | 9 | 2019-03-21T20:24:14.000Z | 2022-01-29T21:12:16.000Z | from cra_helper import STATIC_ASSET_MANIFEST
def static(request):
if STATIC_ASSET_MANIFEST:
return STATIC_ASSET_MANIFEST
return {}
| 16.666667 | 44 | 0.753333 | from cra_helper import STATIC_ASSET_MANIFEST
def static(request):
if STATIC_ASSET_MANIFEST:
return STATIC_ASSET_MANIFEST
return {}
| true | true |
1c452b463aa824b02cb38ecbe8f981d73b33f2d7 | 169 | py | Python | apps/account/urls.py | 8area8/p8_pure_beurre | 9e930f52a5f2c4c6c25a0a52b247f7b61fc7ffe8 | [
"MIT"
] | null | null | null | apps/account/urls.py | 8area8/p8_pure_beurre | 9e930f52a5f2c4c6c25a0a52b247f7b61fc7ffe8 | [
"MIT"
] | 3 | 2020-06-05T19:09:18.000Z | 2022-02-10T13:20:38.000Z | apps/account/urls.py | 8area8/p8_pure_beurre | 9e930f52a5f2c4c6c25a0a52b247f7b61fc7ffe8 | [
"MIT"
] | null | null | null | """account urls."""
from django.urls import path
from django.conf.urls import url
from . import views
urlpatterns = [
path('', views.account, name='account'),
]
| 14.083333 | 44 | 0.680473 |
from django.urls import path
from django.conf.urls import url
from . import views
urlpatterns = [
path('', views.account, name='account'),
]
| true | true |
1c452b77744be37b8ba91f4297cc5bee8a543b0b | 6,704 | py | Python | build/driver/depth_camera/image_transport_plugins/compressed_depth_image_transport/catkin_generated/pkg.installspace.context.pc.py | lty1994/atuolabor | 42b8c52eac93a2e48fbd64275c7dd426a988000c | [
"Apache-2.0"
] | null | null | null | build/driver/depth_camera/image_transport_plugins/compressed_depth_image_transport/catkin_generated/pkg.installspace.context.pc.py | lty1994/atuolabor | 42b8c52eac93a2e48fbd64275c7dd426a988000c | [
"Apache-2.0"
] | null | null | null | build/driver/depth_camera/image_transport_plugins/compressed_depth_image_transport/catkin_generated/pkg.installspace.context.pc.py | lty1994/atuolabor | 42b8c52eac93a2e48fbd64275c7dd426a988000c | [
"Apache-2.0"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/lty/catkin_ws/install/include;/opt/ros/kinetic/include/opencv-3.3.1-dev;/opt/ros/kinetic/include/opencv-3.3.1-dev/opencv".split(';') if "/home/lty/catkin_ws/install/include;/opt/ros/kinetic/inclu... | 744.888889 | 6,082 | 0.800716 |
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/lty/catkin_ws/install/include;/opt/ros/kinetic/include/opencv-3.3.1-dev;/opt/ros/kinetic/include/opencv-3.3.1-dev/opencv".split(';') if "/home/lty/catkin_ws/install/include;/opt/ros/kinetic/include/opencv-3.3.1-dev;/opt/ros/kinetic/include/opencv-3.3.... | true | true |
1c452c8a6569b75610cdf1914eeb687f42106575 | 196 | py | Python | ferminet_ecp/integral/__init__.py | bytedance/FermiNet_with_ECP | f86874513541866db6b89559698e2078d4e37f7c | [
"Apache-2.0"
] | 3 | 2022-01-11T03:31:00.000Z | 2022-01-18T07:28:24.000Z | ferminet_ecp/integral/__init__.py | bytedance/FermiNet_with_ECP | f86874513541866db6b89559698e2078d4e37f7c | [
"Apache-2.0"
] | null | null | null | ferminet_ecp/integral/__init__.py | bytedance/FermiNet_with_ECP | f86874513541866db6b89559698e2078d4e37f7c | [
"Apache-2.0"
] | 1 | 2022-01-05T17:39:53.000Z | 2022-01-05T17:39:53.000Z | # Copyright (c) ByteDance, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree. | 39.2 | 61 | 0.760204 | true | true | |
1c452ced1d02e0be92216546022c19ebe1d5e3d7 | 5,219 | py | Python | packages/python/plotly/plotly/graph_objs/scatterternary/unselected/_textfont.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/scatterternary/unselected/_textfont.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/scatterternary/unselected/_textfont.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "scatterternary.unselected"
_path_str = "scatterternary.unselected.textfont"
_valid_props =... | 36.753521 | 82 | 0.564284 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Textfont(_BaseTraceHierarchyType):
_parent_path_str = "scatterternary.unselected"
_path_str = "scatterternary.unselected.textfont"
_valid_props = {"color"}
@property
... | true | true |
1c452d29c806e98640fff6394a519a69547d9461 | 21,953 | py | Python | sdk/storage/azure-storage-queue/azure/storage/queue/_shared/utils.py | vchske/azure-sdk-for-python | 6383ed3676b7355af7be394562b126209961ec13 | [
"MIT"
] | null | null | null | sdk/storage/azure-storage-queue/azure/storage/queue/_shared/utils.py | vchske/azure-sdk-for-python | 6383ed3676b7355af7be394562b126209961ec13 | [
"MIT"
] | 1 | 2019-06-04T18:12:16.000Z | 2019-06-04T18:12:16.000Z | sdk/storage/azure-storage-queue/azure/storage/queue/_shared/utils.py | vchske/azure-sdk-for-python | 6383ed3676b7355af7be394562b126209961ec13 | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from typi... | 36.166392 | 125 | 0.651802 |
from typing import (
Union, Optional, Any, Iterable, Dict, List, Type, Tuple,
TYPE_CHECKING
)
import base64
import hashlib
import hmac
import logging
from os import fstat
from io import (SEEK_END, SEEK_SET, UnsupportedOperation)
try:
from urllib.parse import quote, unquote, parse_qs
except ImportEr... | true | true |
1c4530276fcdb695658f172383b6ef0f338a039e | 47 | py | Python | deepclaw/utils/success_label/__init__.py | Nokkxz/ME336-Yellow-Team-Project | 5b6d65ecb134049ba3c5d27c37f521ada79a913f | [
"MIT"
] | 5 | 2020-06-24T03:47:00.000Z | 2021-10-13T03:35:38.000Z | deepclaw/utils/success_label/__init__.py | Nokkxz/ME336-Yellow-Team-Project | 5b6d65ecb134049ba3c5d27c37f521ada79a913f | [
"MIT"
] | null | null | null | deepclaw/utils/success_label/__init__.py | Nokkxz/ME336-Yellow-Team-Project | 5b6d65ecb134049ba3c5d27c37f521ada79a913f | [
"MIT"
] | 3 | 2020-06-18T09:25:39.000Z | 2021-04-18T03:51:08.000Z | __all__ = ['DetectForeground', 'success_label'] | 47 | 47 | 0.765957 | __all__ = ['DetectForeground', 'success_label'] | true | true |
1c453071197a502639b6057e02299e32868cc15f | 392 | py | Python | generate-schema.py | akhmetzaki/amplitude-bigquery | 9c637198aa85518d72acb1184f06279497de3189 | [
"MIT"
] | null | null | null | generate-schema.py | akhmetzaki/amplitude-bigquery | 9c637198aa85518d72acb1184f06279497de3189 | [
"MIT"
] | null | null | null | generate-schema.py | akhmetzaki/amplitude-bigquery | 9c637198aa85518d72acb1184f06279497de3189 | [
"MIT"
] | null | null | null | import pandas as pd
import json
def parse_json():
with open('bigquery-schema-events.json', 'r') as f:
events_df = pd.DataFrame(json.loads(f.read()))
with open('bigquery-schema-events-properties.json') as f:
prop_df = pd.DataFrame(json.loads(f.read()))
events_df.to_csv('events.csv')
p... | 23.058824 | 61 | 0.660714 | import pandas as pd
import json
def parse_json():
with open('bigquery-schema-events.json', 'r') as f:
events_df = pd.DataFrame(json.loads(f.read()))
with open('bigquery-schema-events-properties.json') as f:
prop_df = pd.DataFrame(json.loads(f.read()))
events_df.to_csv('events.csv')
p... | true | true |
1c4530e1085d4b99291f8b076baa1a404e14de62 | 1,161 | py | Python | openpmd_updater/transforms/v2_0_0/Version.py | openPMD/openPMD-updater | 1f334c99093b7175af990d57879ea24ff5b4cb01 | [
"ISC"
] | 1 | 2019-03-28T13:29:44.000Z | 2019-03-28T13:29:44.000Z | openpmd_updater/transforms/v2_0_0/Version.py | openPMD/openPMD-updater | 1f334c99093b7175af990d57879ea24ff5b4cb01 | [
"ISC"
] | 3 | 2018-11-06T15:51:42.000Z | 2020-02-03T16:38:29.000Z | openpmd_updater/transforms/v2_0_0/Version.py | openPMD/openPMD-updater | 1f334c99093b7175af990d57879ea24ff5b4cb01 | [
"ISC"
] | 2 | 2018-11-07T18:10:21.000Z | 2020-01-22T03:29:02.000Z | """
This file is part of the openPMD-updater.
Copyright 2018 openPMD contributors
Authors: Axel Huebl
License: ISC
"""
from openpmd_updater.transforms.ITransform import ITransform
import numpy as np
class Version(ITransform):
"""
Transforms the openPMD version.
openPMD standard: 1.*.* -> 2.0.0
Rel... | 26.386364 | 83 | 0.676141 |
from openpmd_updater.transforms.ITransform import ITransform
import numpy as np
class Version(ITransform):
name = "version", "replace openPMD version identifier with new version"
min_version = "1.0.0"
to_version = "2.0.0"
def __init__(self, backend):
self.fb = backend
def transform(s... | true | true |
1c4530f68bcd141ac33d9dab2284d8d8685dbe9c | 250 | py | Python | nsd1903/devops/day01/mtprint4.py | MrWangwf/nsd2019 | 5e859b4b1926dc098d236be3720779c50d0a55fc | [
"Apache-2.0"
] | 1 | 2019-09-19T04:53:22.000Z | 2019-09-19T04:53:22.000Z | nsd1903/devops/day01/mtprint4.py | MrWangwf/nsd2019 | 5e859b4b1926dc098d236be3720779c50d0a55fc | [
"Apache-2.0"
] | null | null | null | nsd1903/devops/day01/mtprint4.py | MrWangwf/nsd2019 | 5e859b4b1926dc098d236be3720779c50d0a55fc | [
"Apache-2.0"
] | 1 | 2021-12-28T04:26:02.000Z | 2021-12-28T04:26:02.000Z | import threading
class MyClass:
def __call__(self, a, b, c):
print('Hello', a, b, c)
if __name__ == '__main__':
for i in range(3):
t = threading.Thread(target=MyClass(), args=(10, 20, 30))
t.start() # target(*args)
| 22.727273 | 65 | 0.572 | import threading
class MyClass:
def __call__(self, a, b, c):
print('Hello', a, b, c)
if __name__ == '__main__':
for i in range(3):
t = threading.Thread(target=MyClass(), args=(10, 20, 30))
t.start()
| true | true |
1c4531039560c0133de2c7dd58e494b440bb52fe | 3,438 | py | Python | d2relay.py | seichter/d2relay | 23e3e727b4de80e6e685964b7339ef0652d9ed8d | [
"MIT"
] | null | null | null | d2relay.py | seichter/d2relay | 23e3e727b4de80e6e685964b7339ef0652d9ed8d | [
"MIT"
] | null | null | null | d2relay.py | seichter/d2relay | 23e3e727b4de80e6e685964b7339ef0652d9ed8d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
D2 is a minimal relay tool to output Leica DISTO D2 data to the console
Copyrights (c) 2021 Hartmut Seichter
Distributed under the terms of the MIT License
"""
import gatt
import struct
debug_mode = False
keepalive_hack = True
class DISTOManager(gatt.DeviceManager):
def __init__(se... | 33.705882 | 121 | 0.613729 |
import gatt
import struct
debug_mode = False
keepalive_hack = True
class DISTOManager(gatt.DeviceManager):
def __init__(self, adapter_name):
super().__init__(adapter_name)
def run(self):
super().run()
def on_idle(self):
pass
class DISTO(gatt.Device):
def connect_succeed... | true | true |
1c4531cb438cfc0c8e48462c8037d07548cfe931 | 44,723 | py | Python | nova/api/openstack/wsgi.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/wsgi.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | 1 | 2021-03-21T11:39:52.000Z | 2021-03-21T11:39:52.000Z | nova/api/openstack/wsgi.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | 1 | 2021-03-21T11:37:33.000Z | 2021-03-21T11:37:33.000Z | # Copyright 2013 IBM Corp.
# Copyright 2011 OpenStack Foundation
# 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/LIC... | 35.721246 | 79 | 0.612034 |
import functools
import inspect
import math
import time
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import strutils
import six
import webob
from nova.api.openstack import api_version_request as api_version
from nova.api.openstack import versioned_method... | true | true |
1c4531d80c6d31acc1cfb7c059317df37a5ce0ad | 896 | py | Python | nally/core/layers/raw_packet.py | FreibergVlad/port-scanner | 432dd9a07cb5118f3a0722fe4908434c76191b3b | [
"MIT"
] | null | null | null | nally/core/layers/raw_packet.py | FreibergVlad/port-scanner | 432dd9a07cb5118f3a0722fe4908434c76191b3b | [
"MIT"
] | null | null | null | nally/core/layers/raw_packet.py | FreibergVlad/port-scanner | 432dd9a07cb5118f3a0722fe4908434c76191b3b | [
"MIT"
] | null | null | null | from nally.core.layers.packet import Packet
class RawPacket(Packet):
"""
Raw implementation of Packet interface.
Actually, just a holder of raw bytes
"""
def __init__(self, raw_packet):
super().__init__()
self.__raw_packet = bytes(raw_packet)
def to_bytes(self):
retur... | 24.888889 | 71 | 0.66183 | from nally.core.layers.packet import Packet
class RawPacket(Packet):
def __init__(self, raw_packet):
super().__init__()
self.__raw_packet = bytes(raw_packet)
def to_bytes(self):
return self.__raw_packet
@staticmethod
def from_bytes(bytes_packet: bytes):
return RawPac... | true | true |
1c453226bdc6a0908183e8c5c8f5eb83db899edf | 17,813 | py | Python | ProjectFiles/bin/Release/2.80/scripts/addons/add_advanced_objects_panels/__init__.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2019-07-08T15:51:14.000Z | 2019-07-08T15:51:14.000Z | ProjectFiles/bin/Release/2.80/scripts/addons/add_advanced_objects_panels/__init__.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | ProjectFiles/bin/Release/2.80/scripts/addons/add_advanced_objects_panels/__init__.py | BlazesRus/Bforartists | 126bdd9e47cc984fd97ba5299bfb92ec5278e754 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 34.521318 | 102 | 0.547016 | "/Py/Scripts/Object/Add_Advanced",
"category": "Object"
}
import bpy
from bpy.types import (
AddonPreferences,
PropertyGroup,
)
from bpy.props import (
BoolProperty,
BoolVectorProperty,
EnumProperty,
FloatProperty,
FloatVectorProperty,
... | true | true |
1c4533e70cb3d4cda0a63ef32b57e6f92afbb550 | 433 | py | Python | setup_moleval.py | MorganCThomas/MolScore | b12b7b5539bb3211982fc7a1b5938c0f383a05c0 | [
"MIT"
] | 28 | 2020-12-11T22:10:16.000Z | 2022-02-25T05:00:51.000Z | setup_moleval.py | MorganCThomas/MolScore | b12b7b5539bb3211982fc7a1b5938c0f383a05c0 | [
"MIT"
] | 3 | 2021-08-31T22:50:41.000Z | 2021-11-04T15:41:01.000Z | setup_moleval.py | MorganCThomas/MolScore | b12b7b5539bb3211982fc7a1b5938c0f383a05c0 | [
"MIT"
] | 9 | 2021-03-03T12:10:10.000Z | 2022-02-15T06:53:11.000Z | from setuptools import setup, find_packages
setup(
name='moleval',
version='1.0',
packages=['moleval'] + ['moleval.'+p for p in find_packages(where="moleval")],
license='MIT',
author='Morgan Thomas',
author_email='morganthomas263@gmail.com',
description='A evaluation framework for goal dire... | 30.928571 | 82 | 0.69746 | from setuptools import setup, find_packages
setup(
name='moleval',
version='1.0',
packages=['moleval'] + ['moleval.'+p for p in find_packages(where="moleval")],
license='MIT',
author='Morgan Thomas',
author_email='morganthomas263@gmail.com',
description='A evaluation framework for goal dire... | true | true |
1c45356cce2b4f69b3bb2ad77abcc74a79c6c0af | 272 | py | Python | src/openbiolink/gui/tqdmbuf.py | jerryhluo/OpenBioLink | 6fc073af978daec0b0db5938b73beed37f57f495 | [
"MIT"
] | 97 | 2019-11-26T09:53:18.000Z | 2022-03-19T10:33:10.000Z | src/openbiolink/gui/tqdmbuf.py | jerryhluo/OpenBioLink | 6fc073af978daec0b0db5938b73beed37f57f495 | [
"MIT"
] | 67 | 2019-12-09T21:01:52.000Z | 2021-12-21T15:19:41.000Z | src/openbiolink/gui/tqdmbuf.py | jerryhluo/OpenBioLink | 6fc073af978daec0b0db5938b73beed37f57f495 | [
"MIT"
] | 20 | 2020-01-13T23:02:25.000Z | 2022-03-16T21:43:31.000Z | import io
class TqdmBuffer(io.StringIO):
foo = ""
buf = ""
def __init__(self):
super(TqdmBuffer, self).__init__()
def write(self, buf):
TqdmBuffer.foo = buf.strip("\r\n\t ")
def flush(self):
TqdmBuffer.buf = TqdmBuffer.foo
| 17 | 45 | 0.580882 | import io
class TqdmBuffer(io.StringIO):
foo = ""
buf = ""
def __init__(self):
super(TqdmBuffer, self).__init__()
def write(self, buf):
TqdmBuffer.foo = buf.strip("\r\n\t ")
def flush(self):
TqdmBuffer.buf = TqdmBuffer.foo
| true | true |
1c453596a670a84db2e2af489075f7f2a241bdfa | 154 | py | Python | arc086_a.py | hythof/atc | 12cb94ebe693e1f469ce0d982bc2924b586552cd | [
"CC0-1.0"
] | null | null | null | arc086_a.py | hythof/atc | 12cb94ebe693e1f469ce0d982bc2924b586552cd | [
"CC0-1.0"
] | null | null | null | arc086_a.py | hythof/atc | 12cb94ebe693e1f469ce0d982bc2924b586552cd | [
"CC0-1.0"
] | null | null | null | from collections import Counter
N,K,*A = [int(x) for x in open(0).read().split()]
c=Counter(A)
s=c.most_common()[K:]
ans=sum([n for _,n in s])
print(ans)
| 22 | 49 | 0.655844 | from collections import Counter
N,K,*A = [int(x) for x in open(0).read().split()]
c=Counter(A)
s=c.most_common()[K:]
ans=sum([n for _,n in s])
print(ans)
| true | true |
1c4535bc026eff090d7af84d54154e33b7a62cfe | 2,673 | py | Python | rgd/geodata/api/download.py | Erotemic/ResonantGeoData | ff9aec9daf73353bcc95a9d30e98fcc5cdffc6e0 | [
"Apache-2.0"
] | null | null | null | rgd/geodata/api/download.py | Erotemic/ResonantGeoData | ff9aec9daf73353bcc95a9d30e98fcc5cdffc6e0 | [
"Apache-2.0"
] | null | null | null | rgd/geodata/api/download.py | Erotemic/ResonantGeoData | ff9aec9daf73353bcc95a9d30e98fcc5cdffc6e0 | [
"Apache-2.0"
] | null | null | null | from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404 # , render
from drf_yasg.utils import swagger_auto_schema
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rgd.geodata import models
from rgd.geodata.permissions import check_rea... | 33 | 112 | 0.737748 | from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from drf_yasg.utils import swagger_auto_schema
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rgd.geodata import models
from rgd.geodata.permissions import check_read_perm
@... | true | true |
1c45386d87d0096209f4bdb484bfc04696f23f4b | 15,690 | py | Python | python/ccxt/async_support/bit2c.py | FullStackHan/ccxt | 1efa15e162e23bae91215aa5d1e5199ebb7fe39e | [
"MIT"
] | null | null | null | python/ccxt/async_support/bit2c.py | FullStackHan/ccxt | 1efa15e162e23bae91215aa5d1e5199ebb7fe39e | [
"MIT"
] | null | null | null | python/ccxt/async_support/bit2c.py | FullStackHan/ccxt | 1efa15e162e23bae91215aa5d1e5199ebb7fe39e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
# -----------------------------------------------------------------------------
try... | 39.621212 | 137 | 0.476801 |
rt.base.exchange import Exchange
try:
basestring
except NameError:
basestring = str
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ArgumentsRequired
class bit2c (Exchange):
def describe(self):
return self.deep_extend(super(bit2c, self).describe(),... | true | true |
1c4538cc2359718686d6db32146a5a2b4f7febf8 | 801 | py | Python | apps/MixMaster/Units/specificEntropy.py | VishalKandala/Cantera-1.7 | 750786f9b845a56fc177a9f1d5a9c5bb6ebd87cc | [
"BSD-3-Clause"
] | null | null | null | apps/MixMaster/Units/specificEntropy.py | VishalKandala/Cantera-1.7 | 750786f9b845a56fc177a9f1d5a9c5bb6ebd87cc | [
"BSD-3-Clause"
] | null | null | null | apps/MixMaster/Units/specificEntropy.py | VishalKandala/Cantera-1.7 | 750786f9b845a56fc177a9f1d5a9c5bb6ebd87cc | [
"BSD-3-Clause"
] | null | null | null | #!/bin/env python
#
#--------------------------------------------------------------------------
#
# $License$
#
#--------------------------------------------------------------------------
# $Log: specificEntropy.py,v $
# Revision 1.1.1.1 2003/04/14 17:57:49 dggoodwin
# Initial import.
#
# Revision 1.1 2... | 22.25 | 76 | 0.515605 |
import SI, energy, mass
units = ['J__kg_K', 'kJ__kg_K', 'cal__g_K']
J__kg_K = SI.joule/(SI.kilogram * SI.kelvin)
kJ__kg_K = 1000.0*J__kg_K
cal__g_K = energy.calorie/(mass.gram * SI.kelvin)
| true | true |
1c4538dde779970879db26d139380a7fc2409bbd | 683 | py | Python | architectures/arch_dsprite_burgess-g_kyle_d_vae.py | christopher-beckham/amr | 1bd67b9b4fb2fcf07cc8faba3c863f5ad5d4c4c0 | [
"BSD-3-Clause"
] | 35 | 2019-08-27T08:59:53.000Z | 2021-09-19T15:55:34.000Z | architectures/arch_dsprite_burgess-g_kyle_d_vae.py | christopher-beckham/amr | 1bd67b9b4fb2fcf07cc8faba3c863f5ad5d4c4c0 | [
"BSD-3-Clause"
] | 4 | 2020-01-14T05:09:31.000Z | 2020-05-25T20:39:55.000Z | architectures/arch_dsprite_burgess-g_kyle_d_vae.py | christopher-beckham/amr | 1bd67b9b4fb2fcf07cc8faba3c863f5ad5d4c4c0 | [
"BSD-3-Clause"
] | 3 | 2019-12-24T01:29:49.000Z | 2020-12-06T01:56:19.000Z | import torch
from torch import nn
import torch.nn.functional as F
#from .shared import networks
from .konny.model import BetaVAE_B
from . import discriminators
from functools import partial
# TODO: add logging to this
def get_network(n_channels, ndf, **kwargs):
gen = BetaVAE_B(nc=n_channels, vae=True)
disc_x =... | 31.045455 | 62 | 0.541728 | import torch
from torch import nn
import torch.nn.functional as F
from .konny.model import BetaVAE_B
from . import discriminators
from functools import partial
def get_network(n_channels, ndf, **kwargs):
gen = BetaVAE_B(nc=n_channels, vae=True)
disc_x = discriminators.Discriminator(nf=ndf,
... | true | true |
1c4539377f1b84b2035abe30a51c80e4b68b7573 | 4,856 | py | Python | .venv/lib/python2.7/site-packages/celery/backends/cache.py | MansoorHanif/FYP-web-app | 918008d3b5eedaa904f3e720296afde9d73ac3f4 | [
"BSD-3-Clause"
] | 4 | 2018-10-19T04:36:20.000Z | 2020-02-13T16:14:09.000Z | .venv/lib/python2.7/site-packages/celery/backends/cache.py | MansoorHanif/FYP-web-app | 918008d3b5eedaa904f3e720296afde9d73ac3f4 | [
"BSD-3-Clause"
] | 3 | 2020-02-11T23:03:45.000Z | 2021-06-10T18:05:11.000Z | oo/lib/python3.5/site-packages/celery/backends/cache.py | chunky2808/SPOJ-history-Django-App | 490c58b1593cd3626f0ddc27fdd09c6e8d1c56e1 | [
"MIT"
] | 1 | 2019-10-26T04:20:52.000Z | 2019-10-26T04:20:52.000Z | # -*- coding: utf-8 -*-
"""Memcached and in-memory cache result backend."""
from __future__ import absolute_import, unicode_literals
import sys
from kombu.utils.encoding import bytes_to_str, ensure_bytes
from kombu.utils.objects import cached_property
from celery.exceptions import ImproperlyConfigured
from celery.utils... | 29.975309 | 79 | 0.632208 |
from __future__ import absolute_import, unicode_literals
import sys
from kombu.utils.encoding import bytes_to_str, ensure_bytes
from kombu.utils.objects import cached_property
from celery.exceptions import ImproperlyConfigured
from celery.utils.functional import LRUCache
from .base import KeyValueStoreBackend
__all__... | true | true |
1c453bfaaf39c5377c870fdd45ad36ff26553b79 | 13,662 | py | Python | Behavioral decoding/HPC code/Flint_HPC_BDP_S_test.py | Next-Generation-Neural-Interfaces/Hardware-efficient-MUA-compression | 853c6e0f3d085812e88fd0572ac7c64a172255d7 | [
"MIT"
] | null | null | null | Behavioral decoding/HPC code/Flint_HPC_BDP_S_test.py | Next-Generation-Neural-Interfaces/Hardware-efficient-MUA-compression | 853c6e0f3d085812e88fd0572ac7c64a172255d7 | [
"MIT"
] | null | null | null | Behavioral decoding/HPC code/Flint_HPC_BDP_S_test.py | Next-Generation-Neural-Interfaces/Hardware-efficient-MUA-compression | 853c6e0f3d085812e88fd0572ac7c64a172255d7 | [
"MIT"
] | 1 | 2022-02-23T21:52:02.000Z | 2022-02-23T21:52:02.000Z | """
Evaluating spike-based BMI decoding using Wiener filter
Load Flint data from matlab. HPC version.
"""
# import packages
import numpy as np
from HPC_working_dir.functions.preprocess import input_shaping, split_index
from HPC_working_dir.functions.decoders import WienerCascadeDecoder
from HPC_working_dir.fu... | 48.792857 | 155 | 0.480091 |
import numpy as np
from HPC_working_dir.functions.preprocess import input_shaping, split_index
from HPC_working_dir.functions.decoders import WienerCascadeDecoder
from HPC_working_dir.functions.metrics import compute_rmse, compute_pearson
import time as timer
import pickle
from scipy import io
import copy
... | true | true |
1c453de5d7c24725e9fd95307eec625076dae59e | 9,931 | py | Python | hchztests/tests/test_container_virtualssh.py | codedsk/hubcheck-hubzero-tests | 89dd7164fed9161a5bf80e0a5635cec3da5be31d | [
"MIT"
] | 1 | 2016-01-02T01:36:14.000Z | 2016-01-02T01:36:14.000Z | hchztests/tests/test_container_virtualssh.py | codedsk/hubcheck-hubzero-tests | 89dd7164fed9161a5bf80e0a5635cec3da5be31d | [
"MIT"
] | null | null | null | hchztests/tests/test_container_virtualssh.py | codedsk/hubcheck-hubzero-tests | 89dd7164fed9161a5bf80e0a5635cec3da5be31d | [
"MIT"
] | null | null | null | import hubcheck
import os
import pytest
import re
import sys
pytestmark = [ pytest.mark.container,
pytest.mark.virtualssh,
pytest.mark.reboot
]
class TestToolSession(hubcheck.testcase.TestCase2):
def setup_method(self,method):
self.username,self.userpass = \
... | 32.243506 | 93 | 0.598631 | import hubcheck
import os
import pytest
import re
import sys
pytestmark = [ pytest.mark.container,
pytest.mark.virtualssh,
pytest.mark.reboot
]
class TestToolSession(hubcheck.testcase.TestCase2):
def setup_method(self,method):
self.username,self.userpass = \
... | true | true |
1c453f426ef1cb4b8320f235713f540c29364267 | 14,600 | py | Python | shade/tests/unit/test__utils.py | obourdon/shade | 6d9a821d722d270bf9b04827a8a65bddbaa68266 | [
"Apache-2.0"
] | null | null | null | shade/tests/unit/test__utils.py | obourdon/shade | 6d9a821d722d270bf9b04827a8a65bddbaa68266 | [
"Apache-2.0"
] | null | null | null | shade/tests/unit/test__utils.py | obourdon/shade | 6d9a821d722d270bf9b04827a8a65bddbaa68266 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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 or agreed to in writing, softw... | 38.32021 | 79 | 0.597603 |
import random
import string
import tempfile
from uuid import uuid4
import mock
import testtools
from shade import _utils
from shade import exc
from shade.tests.unit import base
RANGE_DATA = [
dict(id=1, key1=1, key2=5),
dict(id=2, key1=1, key2=20),
dict(id=3, key1=2, key2=10),
dict(id=... | true | true |
1c453fdbba1ac5b86f5831ece9560ce0e7000157 | 2,630 | py | Python | pytext/utils/distributed.py | twild-fb/pytext | 07cadc0d130dac30d71d9da70380f124b3f5ac59 | [
"BSD-3-Clause"
] | 2 | 2019-06-27T21:32:26.000Z | 2019-10-16T06:20:25.000Z | pytext/utils/distributed.py | twild-fb/pytext | 07cadc0d130dac30d71d9da70380f124b3f5ac59 | [
"BSD-3-Clause"
] | null | null | null | pytext/utils/distributed.py | twild-fb/pytext | 07cadc0d130dac30d71d9da70380f124b3f5ac59 | [
"BSD-3-Clause"
] | 1 | 2019-10-16T06:20:26.000Z | 2019-10-16T06:20:26.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch
import torch.distributed as dist_c10d
def dist_init(
distributed_rank: int,
world_size: int,
init_method: str,
device_id: int,
backend: str = "nccl",
):
"""
1. After spawn process pe... | 32.875 | 82 | 0.653232 |
import torch
import torch.distributed as dist_c10d
def dist_init(
distributed_rank: int,
world_size: int,
init_method: str,
device_id: int,
backend: str = "nccl",
):
if init_method and world_size > 1 and torch.cuda.is_available():
dist_c10d.init_process_group(
backend=ba... | true | true |
1c4542bacaf77780be537b1e01682b77026b72b7 | 1,980 | py | Python | twitter_bot.py | sankarsh98/Twitter-Bot | 34e7503ef31c452ff596a60aba8bfbb7fecf08b6 | [
"MIT"
] | 7 | 2021-12-12T16:34:19.000Z | 2022-02-14T12:07:56.000Z | twitter_bot.py | sankarsh98/Twitter-Bot | 34e7503ef31c452ff596a60aba8bfbb7fecf08b6 | [
"MIT"
] | 1 | 2021-12-12T17:00:04.000Z | 2021-12-12T17:00:04.000Z | twitter_bot.py | sankarsh98/Twitter-Bot | 34e7503ef31c452ff596a60aba8bfbb7fecf08b6 | [
"MIT"
] | 1 | 2021-12-12T13:21:52.000Z | 2021-12-12T13:21:52.000Z |
import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
# path to chrome driver, download it from https://sites.google.com/a/chromium.org/chromedriver/downloads
chrome_driver = "/Users/sanky/Downloads/chromedriver"
clas... | 31.935484 | 104 | 0.664646 |
import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
chrome_driver = "/Users/sanky/Downloads/chromedriver"
class TwitterBot:
def __init__(self,username,password,mobile):
self.browser=webdriver.Chrome(ch... | true | true |
1c4542fc2ee748a53f8ebeb36b01b0d73b072b42 | 688 | py | Python | files/autoupdate-you-resume-for-hh.ru/25_search_of_line_items_of_number.py | SKDCO/SKDCO | d19147f25f5ac25e7e846988c5484eabf49a681e | [
"Apache-2.0"
] | 2 | 2021-11-12T12:43:15.000Z | 2021-11-13T11:16:36.000Z | files/autoupdate-you-resume-for-hh.ru/25_search_of_line_items_of_number.py | SKDCO/SKDCO | d19147f25f5ac25e7e846988c5484eabf49a681e | [
"Apache-2.0"
] | 1 | 2021-04-12T13:38:12.000Z | 2021-04-12T13:38:12.000Z | files/autoupdate-you-resume-for-hh.ru/25_search_of_line_items_of_number.py | SKDCO/SKDCO | d19147f25f5ac25e7e846988c5484eabf49a681e | [
"Apache-2.0"
] | 2 | 2021-07-26T07:31:20.000Z | 2021-11-02T05:36:06.000Z | Напишите программу, которая считывает список чисел lst из
первой строки и число x из второй строки, которая выводит
все позиции, на которых встречается число x в переданном списке lst.
Позиции нумеруются с нуля, если число x не встречается в
списке, вывести строку "Отсутствует" (без кавычек, с большой буквы).
Пози... | 27.52 | 68 | 0.668605 | Напишите программу, которая считывает список чисел lst из
первой строки и число x из второй строки, которая выводит
все позиции, на которых встречается число x в переданном списке lst.
Позиции нумеруются с нуля, если число x не встречается в
списке, вывести строку "Отсутствует" (без кавычек, с большой буквы).
Пози... | false | true |
1c45432e3476eee07bd3665a03b2d5e4c182b9bb | 6,538 | py | Python | selfdrive/manager/manager.py | cfranyota/openpilot | 977a0d829f0c6e373ffc6c3876d2cff77a1a5df2 | [
"MIT"
] | 2 | 2022-01-07T09:00:14.000Z | 2022-01-07T10:06:02.000Z | selfdrive/manager/manager.py | cfranyota/openpilot | 977a0d829f0c6e373ffc6c3876d2cff77a1a5df2 | [
"MIT"
] | null | null | null | selfdrive/manager/manager.py | cfranyota/openpilot | 977a0d829f0c6e373ffc6c3876d2cff77a1a5df2 | [
"MIT"
] | 3 | 2021-12-18T18:58:35.000Z | 2022-01-29T05:05:08.000Z | #!/usr/bin/env python3
import datetime
import os
import signal
import subprocess
import sys
import traceback
from typing import List, Tuple, Union
import cereal.messaging as messaging
import selfdrive.sentry as sentry
from common.basedir import BASEDIR
from common.params import Params, ParamKeyType
from common.text_wi... | 27.821277 | 102 | 0.701285 |
import datetime
import os
import signal
import subprocess
import sys
import traceback
from typing import List, Tuple, Union
import cereal.messaging as messaging
import selfdrive.sentry as sentry
from common.basedir import BASEDIR
from common.params import Params, ParamKeyType
from common.text_window import TextWindow... | true | true |
1c45433433a647c579569bbb598afc58791b69df | 402 | py | Python | utils/convert.py | alanhuang122/skyless-utils | 773f23c37a95d97a3346948997b19eccbed8cc24 | [
"MIT"
] | 2 | 2018-09-12T19:47:19.000Z | 2019-11-07T07:46:10.000Z | utils/convert.py | alanhuang122/skyless-utils | 773f23c37a95d97a3346948997b19eccbed8cc24 | [
"MIT"
] | 11 | 2018-08-29T01:49:29.000Z | 2019-07-08T18:54:16.000Z | utils/convert.py | alanhuang122/skyless-utils | 773f23c37a95d97a3346948997b19eccbed8cc24 | [
"MIT"
] | null | null | null | import json
with open('skyless.dat', 'w') as f:
for name in ['areas', 'bargains', 'domiciles', 'events', 'exchanges', 'personae', 'prospects', 'qualities', 'settings', 'ports']:
with open(f'{name}.txt') as g:
data = json.loads(g.read())
for line in data:
... | 44.666667 | 133 | 0.512438 | import json
with open('skyless.dat', 'w') as f:
for name in ['areas', 'bargains', 'domiciles', 'events', 'exchanges', 'personae', 'prospects', 'qualities', 'settings', 'ports']:
with open(f'{name}.txt') as g:
data = json.loads(g.read())
for line in data:
... | true | true |
1c45439138577fd473020f8d53be33fe6f9ba3bf | 421 | py | Python | src/config/config.py | burakkkara/SeniorProject | 1f878a5c007c910f210c900911897ff34c498b12 | [
"Apache-2.0"
] | 2 | 2022-01-10T07:24:06.000Z | 2022-01-10T16:19:18.000Z | src/config/config.py | burakkkara/SeniorProject | 1f878a5c007c910f210c900911897ff34c498b12 | [
"Apache-2.0"
] | null | null | null | src/config/config.py | burakkkara/SeniorProject | 1f878a5c007c910f210c900911897ff34c498b12 | [
"Apache-2.0"
] | null | null | null | # Primary connection info
primary = {
'ip': '192.168.1.34',
'port': 8080
}
# Secondary connection info
secondary = {
'ip': '192.168.43.38',
# 'ip': '192.168.43.3854',
'port': 8081
}
# Test server info
# Resides on AWS
server = {
'ip': '3.134.95.115',
'port': 8080
}
# Request info
requeste... | 14.517241 | 30 | 0.565321 |
primary = {
'ip': '192.168.1.34',
'port': 8080
}
secondary = {
'ip': '192.168.43.38',
'port': 8081
}
server = {
'ip': '3.134.95.115',
'port': 8080
}
requested = {
'httpVersion': 'http://',
'httpPort': 80,
'httpsPort': 443
}
use_anonymous = True
| true | true |
1c45441e2bef433e828fef7485bbc809e1defc92 | 1,097 | py | Python | tests/nark/log_tests.py | shadowmint/python-nark | 7919c544c8386a023f6a9d0ffbc50e1145604528 | [
"Apache-2.0"
] | null | null | null | tests/nark/log_tests.py | shadowmint/python-nark | 7919c544c8386a023f6a9d0ffbc50e1145604528 | [
"Apache-2.0"
] | null | null | null | tests/nark/log_tests.py | shadowmint/python-nark | 7919c544c8386a023f6a9d0ffbc50e1145604528 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Douglas Linder
# 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 or agreed to in writing... | 28.868421 | 74 | 0.703737 |
import unittest
import bootstrap
import nark
class LogTests(unittest.TestCase):
def test_can_create_logger(self):
a = nark.Assert()
i = nark.Logging.get()
a.not_null(i, "Unable to create log instance")
def test_can_log_message(self):
a = nark.Assert()
i = nark.Logging.get()
... | true | true |
1c4544f61fe44587878d56854ec0f0a9d3c481cd | 9,875 | py | Python | src/server.py | HintikkaKimmo/rasa_nlu | cf71683351f86a9880793273c8ce877c411f9de1 | [
"Apache-2.0"
] | 2 | 2016-12-20T13:19:44.000Z | 2017-01-16T10:44:35.000Z | src/server.py | HintikkaKimmo/rasa_nlu | cf71683351f86a9880793273c8ce877c411f9de1 | [
"Apache-2.0"
] | null | null | null | src/server.py | HintikkaKimmo/rasa_nlu | cf71683351f86a9880793273c8ce877c411f9de1 | [
"Apache-2.0"
] | 1 | 2017-01-02T15:16:49.000Z | 2017-01-02T15:16:49.000Z | import argparse
import json
import os
import urllib.parse
import multiprocessing
import glob
import warnings
import logging
from http.server import BaseHTTPRequestHandler, HTTPServer
from rasa_nlu.train import do_train
from rasa_nlu.config import RasaNLUConfig
class RasaNLUServer(object):
def __init__(self, confi... | 39.342629 | 119 | 0.621165 | import argparse
import json
import os
import urllib.parse
import multiprocessing
import glob
import warnings
import logging
from http.server import BaseHTTPRequestHandler, HTTPServer
from rasa_nlu.train import do_train
from rasa_nlu.config import RasaNLUConfig
class RasaNLUServer(object):
def __init__(self, confi... | true | true |
1c4545b66929809658c409e2658cd728b3b89b9f | 453 | py | Python | src/textbook/rosalind_ba5n.py | cowboysmall/rosalind | 021e4392a8fc946b97bbf86bbb8227b28bb5e462 | [
"MIT"
] | null | null | null | src/textbook/rosalind_ba5n.py | cowboysmall/rosalind | 021e4392a8fc946b97bbf86bbb8227b28bb5e462 | [
"MIT"
] | null | null | null | src/textbook/rosalind_ba5n.py | cowboysmall/rosalind | 021e4392a8fc946b97bbf86bbb8227b28bb5e462 | [
"MIT"
] | null | null | null | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../tools'))
import files
import graphs
from collections import defaultdict
def main(argv):
lines = files.read_lines(argv[0])
edges = graphs.edges_from_adjacency_list(lines)
nodes = graphs.nodes_from_edges(edges)
print ', ... | 20.590909 | 68 | 0.724062 | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../tools'))
import files
import graphs
from collections import defaultdict
def main(argv):
lines = files.read_lines(argv[0])
edges = graphs.edges_from_adjacency_list(lines)
nodes = graphs.nodes_from_edges(edges)
print ', ... | false | true |
1c4545eeb5ecae107979a9aeead1b4bcf5bbd9f8 | 1,011 | py | Python | var/spack/repos/builtin/packages/r-lsei/package.py | adrianjhpc/spack | 0a9e4fcee57911f2db586aa50c8873d9cca8de92 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2020-10-15T01:08:42.000Z | 2021-10-18T01:28:18.000Z | var/spack/repos/builtin/packages/r-lsei/package.py | adrianjhpc/spack | 0a9e4fcee57911f2db586aa50c8873d9cca8de92 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2019-07-30T10:12:28.000Z | 2019-12-17T09:02:27.000Z | var/spack/repos/builtin/packages/r-lsei/package.py | adrianjhpc/spack | 0a9e4fcee57911f2db586aa50c8873d9cca8de92 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 5 | 2019-07-30T09:42:14.000Z | 2021-01-25T05:39:20.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RLsei(RPackage):
"""It contains functions that solve least squares linear regression
... | 43.956522 | 95 | 0.736894 |
from spack import *
class RLsei(RPackage):
homepage = "https://cloud.r-project.org/package=lsei"
url = "https://cloud.r-project.org/src/contrib/lsei_1.2-0.tar.gz"
list_url = "https://cloud.r-project.org/src/contrib/Archive/lsei"
version('1.2-0', sha256='4781ebd9ef93880260d5d5f23066580ac060... | true | true |
1c45462adfeb644306dbba088d37aea211810842 | 77,143 | py | Python | if/python/hpdf.py | yabaud/libharu | d84867ebf9f3de6afd661d2cdaff102457fbc371 | [
"Zlib"
] | 1,118 | 2015-01-09T10:40:33.000Z | 2022-03-28T08:19:56.000Z | if/python/hpdf.py | yabaud/libharu | d84867ebf9f3de6afd661d2cdaff102457fbc371 | [
"Zlib"
] | 148 | 2015-01-09T02:47:40.000Z | 2022-03-31T21:10:14.000Z | if/python/hpdf.py | yabaud/libharu | d84867ebf9f3de6afd661d2cdaff102457fbc371 | [
"Zlib"
] | 394 | 2015-01-23T17:06:52.000Z | 2022-03-25T03:50:06.000Z | ##
## * << Haru Free PDF Library 2.0.8 >> -- hpdf.h
## *
## * URL http://libharu.org/
## *
## * Copyright (c) 1999-2006 Takeshi Kanno
## *
## * Permission to use, copy, modify, distribute and sell this software
## * and its documentation for any purpose is hereby granted without fee,
## * provided that the abo... | 36.664924 | 213 | 0.572962 | DF_HANDLE
HPDF_Page=HPDF_HANDLE
HPDF_Pages=HPDF_HANDLE
HPDF_Stream=HPDF_HANDLE
HPDF_Image=HPDF_HANDLE
HPDF_Font=HPDF_HANDLE
HPDF_Outline=HPDF_HANDLE
HPDF_Encoder=HPDF_HANDLE
HPDF_Destination=HPDF_HANDLE
HPDF_XObject=HPDF_HANDLE
HPDF_Annotation=HPDF_HANDLE
HPDF_ExtGState=HPDF_HANDLE
HPDF_GetVersion=haru... | true | true |
1c45468befaec83596d4e2e0316330f6b9f1a238 | 1,638 | py | Python | generator/generator_test.py | kwyckmans/nonogram | f4a28027a269a37c9f266a2f0f6db9920b549c05 | [
"Unlicense"
] | null | null | null | generator/generator_test.py | kwyckmans/nonogram | f4a28027a269a37c9f266a2f0f6db9920b549c05 | [
"Unlicense"
] | 2 | 2022-01-13T03:53:51.000Z | 2022-03-12T00:59:47.000Z | generator/generator_test.py | kwyckmans/nonogram | f4a28027a269a37c9f266a2f0f6db9920b549c05 | [
"Unlicense"
] | null | null | null | import unittest
from generator.generator import CellValue, generate_nonogram
class GeneratorTest(unittest.TestCase):
"""Tests generation of nonograms by providing the generator with various pixel configurations.
TODO: add a single end-to-end test with a very simple image.
"""
def test_generator_for... | 37.227273 | 98 | 0.696581 | import unittest
from generator.generator import CellValue, generate_nonogram
class GeneratorTest(unittest.TestCase):
def test_generator_for_full_black_row(self):
pixel_data = {0: [CellValue.BLACK, CellValue.BLACK]}
nonogram = generate_nonogram(pixel_data=pixel_data)
self.assertIsNotNone(... | true | true |
1c45472ed521b60ea9b1462d18e54e9cdaece161 | 96,554 | py | Python | python/ccxt/async_support/bybit.py | dougvanzee/ccxt | ed06a2d180e02d1006f33be6ba65407ecb0a831b | [
"MIT"
] | 3 | 2021-06-29T16:27:19.000Z | 2021-07-18T08:36:07.000Z | python/ccxt/async_support/bybit.py | Bytedex/ccxt | 3863b5e1d6c77d719ac102b0243964c4946e7abb | [
"MIT"
] | null | null | null | python/ccxt/async_support/bybit.py | Bytedex/ccxt | 3863b5e1d6c77d719ac102b0243964c4946e7abb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authenticatio... | 44.128885 | 253 | 0.461514 |
rt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors import InsufficientFunds
from ccxt.ba... | true | true |
1c45498823d147eda5f301807dd3845f13b71b1d | 5,632 | py | Python | tests/python/relax/test_expr.py | psrivas2/relax | 4329af78eb1dc4c4ff8a61d3bf39aa4034e9cb2a | [
"Apache-2.0"
] | 90 | 2021-11-30T11:58:10.000Z | 2022-03-31T02:24:04.000Z | tests/python/relax/test_expr.py | psrivas2/relax | 4329af78eb1dc4c4ff8a61d3bf39aa4034e9cb2a | [
"Apache-2.0"
] | 64 | 2021-11-22T23:58:23.000Z | 2022-03-31T03:19:22.000Z | tests/python/relax/test_expr.py | psrivas2/relax | 4329af78eb1dc4c4ff8a61d3bf39aa4034e9cb2a | [
"Apache-2.0"
] | 27 | 2021-12-09T22:39:27.000Z | 2022-03-24T23:21:48.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 30.608696 | 64 | 0.636719 |
import pytest
import tvm
from tvm import tir
from tvm import relax as rx
import numpy as np
def test_var() -> None:
v0 = rx.Var("v0")
assert v0.name_hint == "v0"
assert v0.shape_ is None
assert v0._checked_type_ is None
shape_anno = [54, 96]
type_anno = rx.DynTensorType(2, "flo... | true | true |
1c454a4e8e42c6d6b32f7a64da00659348fb0aba | 14,119 | py | Python | cvat/apps/authentication/auth.py | adasdevops/ADAS_UPDATE_STABLE | 306202b4e291b5876e3dd4fdd201c761e9d182f0 | [
"Intel",
"MIT"
] | null | null | null | cvat/apps/authentication/auth.py | adasdevops/ADAS_UPDATE_STABLE | 306202b4e291b5876e3dd4fdd201c761e9d182f0 | [
"Intel",
"MIT"
] | null | null | null | cvat/apps/authentication/auth.py | adasdevops/ADAS_UPDATE_STABLE | 306202b4e291b5876e3dd4fdd201c761e9d182f0 | [
"Intel",
"MIT"
] | 1 | 2022-03-04T09:18:30.000Z | 2022-03-04T09:18:30.000Z | # Copyright (C) 2018 Intel Corporation
#
# SPDX-License-Identifier: MIT
from django.conf import settings
from django.db.models import Q
import rules
from . import AUTH_ROLE
from . import signature
from rest_framework.permissions import BasePermission
from django.core import signing
from rest_framework import authentic... | 39.54902 | 137 | 0.738154 |
from django.conf import settings
from django.db.models import Q
import rules
from . import AUTH_ROLE
from . import signature
from rest_framework.permissions import BasePermission
from django.core import signing
from rest_framework import authentication, exceptions
from rest_framework.authentication import TokenAuth... | true | true |
1c454b16a8c78878e2eced338b13aad8690829d4 | 3,793 | py | Python | modelzoo/hnn.py | ml-jku/mc-lstm | 8bbaece3ecb4187a76c6318d4c6e40c1dcc71303 | [
"MIT"
] | 18 | 2021-03-27T06:31:59.000Z | 2022-02-24T09:48:57.000Z | modelzoo/hnn.py | ml-jku/mc-lstm | 8bbaece3ecb4187a76c6318d4c6e40c1dcc71303 | [
"MIT"
] | null | null | null | modelzoo/hnn.py | ml-jku/mc-lstm | 8bbaece3ecb4187a76c6318d4c6e40c1dcc71303 | [
"MIT"
] | 7 | 2021-03-27T21:01:23.000Z | 2021-09-21T14:27:59.000Z | import torch
from torch import nn
class HNN(nn.Module):
'''Learn arbitrary vector fields that are sums of conservative and solenoidal fields'''
def __init__(self, input_dim, differentiable_model, field_type='solenoidal',
baseline=False, assume_canonical_coords=True):
super(HNN, self)... | 35.448598 | 108 | 0.613499 | import torch
from torch import nn
class HNN(nn.Module):
def __init__(self, input_dim, differentiable_model, field_type='solenoidal',
baseline=False, assume_canonical_coords=True):
super(HNN, self).__init__()
self.baseline = baseline
self.differentiable_model = differentia... | true | true |
1c454b8c0ca00f4367578dddf2f1c44be75fbd3e | 4,182 | py | Python | share/seeds/generate-seeds.py | enixt/enixt | 6bc063558ccb1a66e28d26bd6e2903c2d4346633 | [
"MIT"
] | 1 | 2019-01-15T18:37:03.000Z | 2019-01-15T18:37:03.000Z | share/seeds/generate-seeds.py | enixt/enixt | 6bc063558ccb1a66e28d26bd6e2903c2d4346633 | [
"MIT"
] | null | null | null | share/seeds/generate-seeds.py | enixt/enixt | 6bc063558ccb1a66e28d26bd6e2903c2d4346633 | [
"MIT"
] | 2 | 2018-03-10T19:32:49.000Z | 2019-12-20T01:32:03.000Z | #!/usr/bin/python
# Copyright (c) 2014 Wladmir J. van der Laan
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory ... | 31.681818 | 98 | 0.587996 |
from __future__ import print_function, division
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith... | true | true |
1c454f649b1049f927a2a7419ab2e09e87c4ce45 | 3,531 | py | Python | widgets.py/migrations/0001_initial.py | deejungx/goalza | c9ec93aad13228bccd9f185cfac6ff9e1fc1994a | [
"MIT"
] | 1 | 2019-05-04T11:26:14.000Z | 2019-05-04T11:26:14.000Z | widgets.py/migrations/0001_initial.py | deejungx/goalza | c9ec93aad13228bccd9f185cfac6ff9e1fc1994a | [
"MIT"
] | null | null | null | widgets.py/migrations/0001_initial.py | deejungx/goalza | c9ec93aad13228bccd9f185cfac6ff9e1fc1994a | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-05-02 11:46
import datetime
from django.db import migrations, models
import django.db.models.deletion
import pages.models
import pages.myFields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | 47.08 | 217 | 0.57859 |
import datetime
from django.db import migrations, models
import django.db.models.deletion
import pages.models
import pages.myFields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='FutsalCompany',
... | true | true |
1c454f9b0ae3d0e44d374d4620851100121f28e8 | 70,561 | py | Python | django/db/models/base.py | yswai/django | 90c706e44fa1e640245ad4626f0e3ecb176acce2 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/db/models/base.py | yswai/django | 90c706e44fa1e640245ad4626f0e3ecb176acce2 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/db/models/base.py | yswai/django | 90c706e44fa1e640245ad4626f0e3ecb176acce2 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import copy
import inspect
import warnings
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.core import checks
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned,... | 41.752071 | 114 | 0.572639 | from __future__ import unicode_literals
import copy
import inspect
import warnings
from itertools import chain
from django.apps import apps
from django.conf import settings
from django.core import checks
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned,... | true | true |
1c4552d4e09eadd115dbba54a37526988ca931f4 | 1,291 | py | Python | examples/django/backend/urls.py | envoy/polarwind | bb9781c00abe2b6dfd96b24e8820c6ec50be3e24 | [
"MIT"
] | 15 | 2020-06-23T15:23:53.000Z | 2022-01-12T21:28:06.000Z | examples/django/backend/urls.py | envoy/polarwind | bb9781c00abe2b6dfd96b24e8820c6ec50be3e24 | [
"MIT"
] | 221 | 2020-06-25T18:25:30.000Z | 2022-03-24T13:06:20.000Z | examples/django/backend/urls.py | envoy/polarwind | bb9781c00abe2b6dfd96b24e8820c6ec50be3e24 | [
"MIT"
] | null | null | null | """backend URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 34.891892 | 86 | 0.703331 | from django.contrib import admin
from django.urls import path, re_path, include
from django.conf import settings
from cra_helper.views import proxy_cra_requests
from . import views
urlpatterns = [
path('', views.home_view, name='home'),
path('auth', include('envoy_auth.urls')),
path('admin/', admin.site.... | true | true |
1c45542f594a46b1b10eaa45a732b7fa7822eaba | 11,884 | py | Python | virtual_ta/data_conversions.py | ilankham/virtual-teaching-assistant | 105dddee4284209d1deebbfa60793ba7d99c3748 | [
"MIT"
] | 2 | 2017-11-21T20:42:41.000Z | 2018-03-05T01:18:30.000Z | virtual_ta/data_conversions.py | ilankham/virtual-teaching-assistant | 105dddee4284209d1deebbfa60793ba7d99c3748 | [
"MIT"
] | null | null | null | virtual_ta/data_conversions.py | ilankham/virtual-teaching-assistant | 105dddee4284209d1deebbfa60793ba7d99c3748 | [
"MIT"
] | null | null | null | """Creates functions for converting between data formats"""
from calendar import day_name
from collections import OrderedDict
from csv import DictReader
from datetime import date, timedelta
from io import BytesIO, FileIO, StringIO, TextIOWrapper
from typing import BinaryIO, Dict, List, TextIO, Union
from openpyxl imp... | 38.089744 | 79 | 0.680326 |
from calendar import day_name
from collections import OrderedDict
from csv import DictReader
from datetime import date, timedelta
from io import BytesIO, FileIO, StringIO, TextIOWrapper
from typing import BinaryIO, Dict, List, TextIO, Union
from openpyxl import load_workbook
from ruamel.yaml import YAML
from ruamel.y... | true | true |
1c45545157e97f9c4e1cc68b6cafb654b5d57282 | 439 | py | Python | news/views.py | valch85/newssite | ef612a7bde4ff1d6e1e35f5cc4ec9407f031270e | [
"Apache-2.0"
] | null | null | null | news/views.py | valch85/newssite | ef612a7bde4ff1d6e1e35f5cc4ec9407f031270e | [
"Apache-2.0"
] | 2 | 2020-02-12T00:16:37.000Z | 2020-06-05T20:42:49.000Z | news/views.py | valch85/newssite | ef612a7bde4ff1d6e1e35f5cc4ec9407f031270e | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render, get_object_or_404
from .models import News
# Create your views here.
def index(request):
latest_news_list = News.objects.order_by('-pub_date')[:10]
context = {'latest_news_list': latest_news_list}
return render(request, 'news/index.html', context)
def detail(request, ... | 27.4375 | 62 | 0.728929 | from django.shortcuts import render, get_object_or_404
from .models import News
def index(request):
latest_news_list = News.objects.order_by('-pub_date')[:10]
context = {'latest_news_list': latest_news_list}
return render(request, 'news/index.html', context)
def detail(request, news_id):
new = get_o... | true | true |
1c4554791df5c97d5a6a036317b43076dea94512 | 9,639 | py | Python | celery_manager/static_precompiler/compilers/base.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 45 | 2015-09-30T14:55:33.000Z | 2021-06-28T02:33:30.000Z | celery_manager/static_precompiler/compilers/base.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 261 | 2015-06-03T20:41:56.000Z | 2022-03-07T08:46:10.000Z | celery_manager/static_precompiler/compilers/base.py | churchlab/millstone | ddb5d003a5b8a7675e5a56bafd5c432d9642b473 | [
"MIT"
] | 22 | 2015-06-04T20:43:10.000Z | 2022-02-27T08:27:34.000Z | # coding: utf-8
from django.conf import settings
from django.contrib.staticfiles import finders
from static_precompiler.models import Dependency
from static_precompiler.settings import STATIC_ROOT, ROOT, OUTPUT_DIR
from static_precompiler.utils import get_mtime
import logging
import os
logger = logging.getLogger("sta... | 32.674576 | 90 | 0.641768 |
from django.conf import settings
from django.contrib.staticfiles import finders
from static_precompiler.models import Dependency
from static_precompiler.settings import STATIC_ROOT, ROOT, OUTPUT_DIR
from static_precompiler.utils import get_mtime
import logging
import os
logger = logging.getLogger("static_precompiler... | true | true |
1c4554d8d53932ad17004044f7fe096837dd57b5 | 6,209 | py | Python | infra/bots/recipe_modules/core/api.py | henry-luo/skia | 2f2187b66dca1761f590668d3cbdf07453df7b6f | [
"BSD-3-Clause"
] | null | null | null | infra/bots/recipe_modules/core/api.py | henry-luo/skia | 2f2187b66dca1761f590668d3cbdf07453df7b6f | [
"BSD-3-Clause"
] | null | null | null | infra/bots/recipe_modules/core/api.py | henry-luo/skia | 2f2187b66dca1761f590668d3cbdf07453df7b6f | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0201
import json
import os
import re
import sys
from recipe_engine import recipe_api
from recipe_engine import config_types
class Sk... | 36.739645 | 80 | 0.639717 |
import json
import os
import re
import sys
from recipe_engine import recipe_api
from recipe_engine import config_types
class SkiaApi(recipe_api.RecipeApi):
def setup(self):
self.m.vars.setup()
self.checkout_steps()
if not self.m.path.exists(self.m.vars.tmp_dir):
self.m.run.ru... | true | true |
1c4554eae75d1b7c7c6e5d32aeb944d8689b1f7b | 345 | py | Python | Payment/manage.py | silop4all/payment-api | c331af421cd882d0b82d291251d1ce1c7f1a7223 | [
"Apache-2.0"
] | 2 | 2018-02-27T20:51:15.000Z | 2019-11-25T10:12:06.000Z | Payment/manage.py | silop4all/payment-api | c331af421cd882d0b82d291251d1ce1c7f1a7223 | [
"Apache-2.0"
] | null | null | null | Payment/manage.py | silop4all/payment-api | c331af421cd882d0b82d291251d1ce1c7f1a7223 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Command-line utility for administrative tasks.
"""
import os
import sys
if __name__ == "__main__":
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE",
"Payment.settings"
)
from django.core.management import execute_from_command_line
execute_from... | 19.166667 | 65 | 0.675362 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE",
"Payment.settings"
)
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
1c45550a7c5f0ce477cb38a1f1274ca4f984e780 | 1,326 | py | Python | zerver/management/commands/sync_ldap_user_data.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | null | null | null | zerver/management/commands/sync_ldap_user_data.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | 15 | 2020-06-05T18:44:15.000Z | 2022-03-11T23:26:03.000Z | zerver/management/commands/sync_ldap_user_data.py | Supermanu/zulip | 26f6d708c2e30cfe50d9d61031edb759e8117596 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from typing import Any
from django.core.management.base import BaseCommand
from django.db.utils import IntegrityError
from django.conf import settings
from zproject.backends import ZulipLDAPUserPopulator
from zerver.models import UserProfile
from zerver.lib.logging_util import ... | 35.837838 | 93 | 0.692308 | from __future__ import absolute_import
from typing import Any
from django.core.management.base import BaseCommand
from django.db.utils import IntegrityError
from django.conf import settings
from zproject.backends import ZulipLDAPUserPopulator
from zerver.models import UserProfile
from zerver.lib.logging_util import ... | true | true |
1c4555339357f9adf1c2173ef512a78c397c3626 | 11,032 | py | Python | ReadUndirectedGraph.py | skytreader/pads | 3b5011b6725810ff73ad376b1589d7510c156b1c | [
"MIT"
] | 3 | 2021-09-14T02:05:28.000Z | 2021-11-14T17:05:44.000Z | ReadUndirectedGraph.py | skytreader/pads | 3b5011b6725810ff73ad376b1589d7510c156b1c | [
"MIT"
] | null | null | null | ReadUndirectedGraph.py | skytreader/pads | 3b5011b6725810ff73ad376b1589d7510c156b1c | [
"MIT"
] | null | null | null | """readUndirectedGraph.py
Parse various undirected graph formats
readUndirectedGraph(arg) takes an argument which may be a file object,
string, or list of strings, and returns a parsed undirected graph.
Various input formats are supported and automatically detected:
- MALF, edge list, and node edge list format doc... | 27.58 | 93 | 0.593818 | """readUndirectedGraph.py
Parse various undirected graph formats
readUndirectedGraph(arg) takes an argument which may be a file object,
string, or list of strings, and returns a parsed undirected graph.
Various input formats are supported and automatically detected:
- MALF, edge list, and node edge list format doc... | false | true |
1c45559ff167fb23cf4728841148d6e890c7d890 | 2,190 | py | Python | app.py | ODU-Internship/BedSore | c9927ce181eb48fc93a3d2adf2330cc0ec412182 | [
"MIT"
] | null | null | null | app.py | ODU-Internship/BedSore | c9927ce181eb48fc93a3d2adf2330cc0ec412182 | [
"MIT"
] | null | null | null | app.py | ODU-Internship/BedSore | c9927ce181eb48fc93a3d2adf2330cc0ec412182 | [
"MIT"
] | null | null | null | import os
import plotly.express as px
import plotly.figure_factory as ff
import dash
import dash_core_components as dcc
import dash_html_components as html
import numpy as np
import time
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=ext... | 32.205882 | 79 | 0.607763 | import os
import plotly.express as px
import plotly.figure_factory as ff
import dash
import dash_core_components as dcc
import dash_html_components as html
import numpy as np
import time
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=ext... | true | true |
1c4558ef8db3c87d9205525a1d0af1de3e5c9a0d | 1,816 | py | Python | digitaltmuseum/controllers/duplicates.py | danmichaelo/digimus-commons | 32a44823dadbe0ae0160ff24fcbb7645d8304ff7 | [
"Unlicense"
] | 1 | 2020-08-10T15:12:50.000Z | 2020-08-10T15:12:50.000Z | digitaltmuseum/controllers/duplicates.py | danmichaelo/digimus-commons | 32a44823dadbe0ae0160ff24fcbb7645d8304ff7 | [
"Unlicense"
] | null | null | null | digitaltmuseum/controllers/duplicates.py | danmichaelo/digimus-commons | 32a44823dadbe0ae0160ff24fcbb7645d8304ff7 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
import sqlite3
import urllib.request, urllib.parse, urllib.error
from flask import render_template
from .controller import Controller
class DuplicatesController(Controller):
def __init__(self, app, c... | 39.478261 | 132 | 0.543502 |
import sqlite3
import urllib.request, urllib.parse, urllib.error
from flask import render_template
from .controller import Controller
class DuplicatesController(Controller):
def __init__(self, app, config):
Controller.__init__(self, app)
self.config = config
def get(self):
db = sel... | true | true |
1c45595dbeb1ee754f37d0d735e5cb42d450fdc5 | 463 | py | Python | python3/third_max.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | 1 | 2020-10-08T09:17:40.000Z | 2020-10-08T09:17:40.000Z | python3/third_max.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | null | null | null | python3/third_max.py | joshiaj7/CodingChallenges | f95dd79132f07c296e074d675819031912f6a943 | [
"MIT"
] | null | null | null | """
Space : O(1)
Time : O(n)
"""
class Solution:
def thirdMax(self, nums: List[int]) -> int:
a, b, c = -10**10, -10**10, -10**10
nums = list(set(nums))
n = len(nums)
for i in nums:
a = max(i, a)
if n <= 2:
return a
for j in nums:
... | 15.965517 | 47 | 0.360691 |
class Solution:
def thirdMax(self, nums: List[int]) -> int:
a, b, c = -10**10, -10**10, -10**10
nums = list(set(nums))
n = len(nums)
for i in nums:
a = max(i, a)
if n <= 2:
return a
for j in nums:
if j < a:
b =... | true | true |
1c4559619debbfab81b5667b6115f6d8185615c5 | 1,229 | py | Python | benchmark/generate_libs/jamplus.py | chadaustin/ibb | ea1e25cc53a1ad7c302a12d95fc704c443924dff | [
"MIT"
] | 4 | 2015-04-09T17:24:58.000Z | 2019-07-02T12:05:56.000Z | benchmark/generate_libs/jamplus.py | chadaustin/ibb | ea1e25cc53a1ad7c302a12d95fc704c443924dff | [
"MIT"
] | null | null | null | benchmark/generate_libs/jamplus.py | chadaustin/ibb | ea1e25cc53a1ad7c302a12d95fc704c443924dff | [
"MIT"
] | 1 | 2019-11-08T15:38:29.000Z | 2019-11-08T15:38:29.000Z | #!/usr/bin/python
import os.path
import cppcodebase
import random
def CreateLibJamfile(lib_number, classes):
os.chdir(cppcodebase.lib_name(lib_number))
handle = file("Jamfile.jam", "w")
handle.write ("SubDir TOP lib_" + str(lib_number) + " ;\n\n")
handle.write ("SubDirHdrs $(INCLUDES) ;\n\n")
han... | 29.261905 | 107 | 0.643613 |
import os.path
import cppcodebase
import random
def CreateLibJamfile(lib_number, classes):
os.chdir(cppcodebase.lib_name(lib_number))
handle = file("Jamfile.jam", "w")
handle.write ("SubDir TOP lib_" + str(lib_number) + " ;\n\n")
handle.write ("SubDirHdrs $(INCLUDES) ;\n\n")
handle.write ("Libra... | true | true |
1c4559ad4582ddb2d757dd3fc5e5fa4bd27dcdd3 | 5,260 | py | Python | build/android/pylib/base_test_sharder.py | leiferikb/bitpop-private | 4c967307d228e86f07f2576068a169e846c833ca | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-11-15T15:17:43.000Z | 2021-11-15T15:17:43.000Z | build/android/pylib/base_test_sharder.py | leiferikb/bitpop-private | 4c967307d228e86f07f2576068a169e846c833ca | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | build/android/pylib/base_test_sharder.py | leiferikb/bitpop-private | 4c967307d228e86f07f2576068a169e846c833ca | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2019-02-21T16:13:42.000Z | 2019-02-21T16:13:42.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import android_commands
import logging
import multiprocessing
from android_commands import errors
from forwarder import Forwarder
from test_result impo... | 34.834437 | 79 | 0.680989 |
import android_commands
import logging
import multiprocessing
from android_commands import errors
from forwarder import Forwarder
from test_result import TestResults
def _ShardedTestRunnable(test):
log_format = '[' + test.device + '] # %(asctime)-15s: %(message)s'
if logging.getLogger().handlers:
loggin... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.