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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0d91b7c53abce08fad37998f911e219e8e925a | 3,700 | py | Python | mcycle/library/heat_exchangers.py | ChenlingJ/MCycle | 1fb72be3f889bd5f30c5dbd927f31b3bca2f1c38 | [
"Apache-2.0"
] | 7 | 2018-05-08T08:42:07.000Z | 2022-01-27T14:40:45.000Z | mcycle/library/heat_exchangers.py | ChenlingJ/MCycle | 1fb72be3f889bd5f30c5dbd927f31b3bca2f1c38 | [
"Apache-2.0"
] | 6 | 2018-05-20T05:52:48.000Z | 2019-09-05T19:56:29.000Z | mcycle/library/heat_exchangers.py | ChenlingJ/MCycle | 1fb72be3f889bd5f30c5dbd927f31b3bca2f1c38 | [
"Apache-2.0"
] | 4 | 2018-05-06T20:57:34.000Z | 2021-07-03T04:32:15.000Z | """A brief library of commercial component designs."""
from ..bases import Config
from ..constants import *
from .. import components as cps
from .. import geometries as gms
from . import materials as mats
def alfaLaval_AC30EQ(
flowConfig=cps.hxs.HxFlowConfig(
sense=COUNTERFLOW, passes=1, vertical... | 35.238095 | 217 | 0.620541 | from ..bases import Config
from ..constants import *
from .. import components as cps
from .. import geometries as gms
from . import materials as mats
def alfaLaval_AC30EQ(
flowConfig=cps.hxs.HxFlowConfig(
sense=COUNTERFLOW, passes=1, verticalWf=True, verticalSf=True),
flowInWf=None,
... | true | true |
1c0d9380919d13c084a592639b383ebbbabaf59a | 1,042 | py | Python | bootcamp_utils.py | arice84/bootcamp | 73a5517bcf282fdb2bd8808eb2bfb839eaceadf1 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | bootcamp_utils.py | arice84/bootcamp | 73a5517bcf282fdb2bd8808eb2bfb839eaceadf1 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | bootcamp_utils.py | arice84/bootcamp | 73a5517bcf282fdb2bd8808eb2bfb839eaceadf1 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | """bootcamp utilities a collection of functions that are useful in bootcamp"""
import numpy as np
def ecdf(data):
"""compute x, y values for an empirical distribution function"""
x = np.sort(data)
y = np.arange(1, 1+len(x)) / len(x)
return x, y
def plot_ecdf(x, y):
plt.plot(x, y, marker='.', lines... | 32.5625 | 84 | 0.678503 | import numpy as np
def ecdf(data):
x = np.sort(data)
y = np.arange(1, 1+len(x)) / len(x)
return x, y
def plot_ecdf(x, y):
plt.plot(x, y, marker='.', linestyle='none', markersize=10, alpha=0.5)
plt.ylabel('eCDF')
def bootstrap(data_array, np_stat, reps):
bs_reps = np.empty(reps)
for i ... | true | true |
1c0d93c947bfcc0d15446c5cdf74d0b83babe1d2 | 3,168 | py | Python | benchmarks/thread_benches/plot.py | xnox/BLAKE3-specs | 06c989589e21fb674606f09ee859eed43e6af75e | [
"Apache-2.0"
] | 152 | 2020-01-09T16:48:30.000Z | 2022-03-10T19:04:50.000Z | benchmarks/thread_benches/plot.py | xnox/BLAKE3-specs | 06c989589e21fb674606f09ee859eed43e6af75e | [
"Apache-2.0"
] | 4 | 2020-01-27T16:29:33.000Z | 2020-11-15T22:33:19.000Z | benchmarks/thread_benches/plot.py | xnox/BLAKE3-specs | 06c989589e21fb674606f09ee859eed43e6af75e | [
"Apache-2.0"
] | 8 | 2020-01-11T01:41:35.000Z | 2022-02-10T01:57:18.000Z | #! /usr/bin/env python3
import json
from matplotlib import pyplot
from pathlib import Path
import pandas
import seaborn
import sys
BENCH_NAMES = [
("threads_48", "48 threads"),
("threads_32", "32 threads"),
("threads_16", "16 threads"),
("threads_08", "8 threads"),
("threads_04", "4 threads"),
... | 30.461538 | 79 | 0.55524 |
import json
from matplotlib import pyplot
from pathlib import Path
import pandas
import seaborn
import sys
BENCH_NAMES = [
("threads_48", "48 threads"),
("threads_32", "32 threads"),
("threads_16", "16 threads"),
("threads_08", "8 threads"),
("threads_04", "4 threads"),
("threads_02", "2 threa... | true | true |
1c0d94071fbff87239153235530f4d386b1aa590 | 14,032 | py | Python | pystruct/models/typed_crf.py | LemonLison/pystruct | 5606e643d1a0a3701b93b848a2a02c49e83c4f1e | [
"BSD-2-Clause"
] | 501 | 2015-01-06T16:24:04.000Z | 2022-03-22T03:53:03.000Z | pystruct/models/typed_crf.py | LemonLison/pystruct | 5606e643d1a0a3701b93b848a2a02c49e83c4f1e | [
"BSD-2-Clause"
] | 104 | 2015-01-02T19:05:04.000Z | 2022-02-13T20:18:38.000Z | pystruct/models/typed_crf.py | LemonLison/pystruct | 5606e643d1a0a3701b93b848a2a02c49e83c4f1e | [
"BSD-2-Clause"
] | 145 | 2015-02-04T03:42:52.000Z | 2022-03-04T13:16:37.000Z | # -*- coding: utf-8 -*-
"""
CRF with different types of nodes
NOTE: this is an abstract class. Do not use directly.
JL. Meunier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software witho... | 40.909621 | 79 | 0.565636 |
import numpy as np
from .crf import CRF
from ..inference import get_installed
class InconsistentLabel(Exception):
pass
class TypedCRF(CRF):
def __init__(self,
n_types, l_n_states, l_n_features, inference_... | true | true |
1c0d96eaf311ceb6744d16d786af33a3e5249a1f | 5,551 | py | Python | clarity-ext-scripts/clarity_ext_scripts/covid/review_update_local.py | ctmrbio/claritylims | e4f193e9cd3aa54b2a1974a2ce5b573c397a88eb | [
"MIT"
] | 4 | 2020-04-13T14:52:33.000Z | 2022-02-03T14:50:41.000Z | clarity-ext-scripts/clarity_ext_scripts/covid/review_update_local.py | ctmrbio/claritylims | e4f193e9cd3aa54b2a1974a2ce5b573c397a88eb | [
"MIT"
] | 104 | 2019-04-01T08:35:59.000Z | 2021-05-04T11:53:00.000Z | clarity-ext-scripts/clarity_ext_scripts/covid/review_update_local.py | ctmrbio/claritylims | e4f193e9cd3aa54b2a1974a2ce5b573c397a88eb | [
"MIT"
] | 4 | 2020-04-02T07:06:41.000Z | 2021-08-20T06:42:27.000Z | from clarity_ext.extensions import GeneralExtension
from clarity_ext.domain.validation import UsageError
from clarity_ext_scripts.covid.rtpcr_analysis_service import FAILED_BY_REVIEW
from clarity_ext_scripts.covid.rtpcr_analysis_service import FAILED_STATES
from clarity_ext_scripts.covid.partner_api_client import \
... | 45.130081 | 108 | 0.662763 | from clarity_ext.extensions import GeneralExtension
from clarity_ext.domain.validation import UsageError
from clarity_ext_scripts.covid.rtpcr_analysis_service import FAILED_BY_REVIEW
from clarity_ext_scripts.covid.rtpcr_analysis_service import FAILED_STATES
from clarity_ext_scripts.covid.partner_api_client import \
... | true | true |
1c0d9738b7002c0a4c24708bf03a691bd9bafde4 | 9,319 | py | Python | utils/wrappers.py | mintiti/efficient-rl | d65e9929ebb47bd2264a49b71088e41712611ff6 | [
"MIT"
] | null | null | null | utils/wrappers.py | mintiti/efficient-rl | d65e9929ebb47bd2264a49b71088e41712611ff6 | [
"MIT"
] | null | null | null | utils/wrappers.py | mintiti/efficient-rl | d65e9929ebb47bd2264a49b71088e41712611ff6 | [
"MIT"
] | null | null | null | import gym
from gym.wrappers import TimeLimit
import matplotlib.pyplot as plt
import numpy as np
class DoneOnSuccessWrapper(gym.Wrapper):
"""
Reset on success and offsets the reward.
Useful for GoalEnv.
"""
def __init__(self, env, reward_offset=1.0):
super(DoneOnSuccessWrapper, self).__in... | 35.033835 | 97 | 0.635583 | import gym
from gym.wrappers import TimeLimit
import matplotlib.pyplot as plt
import numpy as np
class DoneOnSuccessWrapper(gym.Wrapper):
def __init__(self, env, reward_offset=1.0):
super(DoneOnSuccessWrapper, self).__init__(env)
self.reward_offset = reward_offset
def step(self, action):
... | true | true |
1c0d97a9ec7e3fd375c626e8e603056ef4a2ff17 | 6,697 | py | Python | bindings/python/ensmallen_graph/datasets/string/aplysiacalifornica.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/aplysiacalifornica.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/aplysiacalifornica.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Aplysia californica.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-02... | 35.062827 | 223 | 0.702553 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def AplysiaCalifornica(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
retu... | true | true |
1c0d98643687fb76bb210afb3266886be34ab584 | 924 | py | Python | clients/keto/python/test/test_input.py | simoneromano96/sdk | a6113d0daefbbb803790297e4b242d4c7cbbcb22 | [
"Apache-2.0"
] | null | null | null | clients/keto/python/test/test_input.py | simoneromano96/sdk | a6113d0daefbbb803790297e4b242d4c7cbbcb22 | [
"Apache-2.0"
] | null | null | null | clients/keto/python/test/test_input.py | simoneromano96/sdk | a6113d0daefbbb803790297e4b242d4c7cbbcb22 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
ORY Keto
A cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs. # noqa: E501
The version of the OpenAPI document: v0.0.0-alpha.1
Contact: hi@ory.sh
Generated by: https://openapi-generator... | 22.536585 | 161 | 0.683983 |
from __future__ import absolute_import
import unittest
import ory_keto_client
from ory_keto_client.models.input import Input from ory_keto_client.rest import ApiException
class TestInput(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testInput(self):
... | true | true |
1c0d99f64c327dcb5fdcad4bf16962b12176c4f2 | 732 | py | Python | Python/n-repeated-element-in-size-2n-array.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2022-01-30T06:55:28.000Z | 2022-01-30T06:55:28.000Z | Python/n-repeated-element-in-size-2n-array.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | null | null | null | Python/n-repeated-element-in-size-2n-array.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2021-12-31T03:56:39.000Z | 2021-12-31T03:56:39.000Z | # Time: O(n)
# Space: O(1)
# 961
# In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeated N times.
# Return the element repeated N times.
# 4 <= A.length <= 10000
# Challenge: can you do it with O(1) space (not using hash table)?
class Solution(object):
def repeate... | 30.5 | 112 | 0.568306 |
class Solution(object):
def repeatedNTimes(self, A):
for i in xrange(2, len(A)):
if A[i-1] == A[i] or A[i-2] == A[i]:
return A[i]
return A[0]
print(Solution().repeatedNTimes([2,1,2,5,3,2])) | true | true |
1c0d9ac8521fc548a8a39e71b523ad2c17eb49ab | 18,951 | py | Python | FedSimulate.py | 0xbadc0ffe/FedSimulate | 1dfa6554c341ea46c02986fca1b61148ea8cd1f3 | [
"MIT"
] | null | null | null | FedSimulate.py | 0xbadc0ffe/FedSimulate | 1dfa6554c341ea46c02986fca1b61148ea8cd1f3 | [
"MIT"
] | null | null | null | FedSimulate.py | 0xbadc0ffe/FedSimulate | 1dfa6554c341ea46c02986fca1b61148ea8cd1f3 | [
"MIT"
] | null | null | null | from __future__ import print_function, division
from cProfile import label
from logging import raiseExceptions
from typing import Mapping, Union, Optional, Callable, Dict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import os
from tqdm import tqdm, t... | 35.029575 | 184 | 0.67379 | from __future__ import print_function, division
from cProfile import label
from logging import raiseExceptions
from typing import Mapping, Union, Optional, Callable, Dict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import os
from tqdm import tqdm, t... | true | true |
1c0d9adce362daafd45952dee5968be54d34d9d6 | 3,195 | py | Python | ch_openwhisk/openwhisk/actionRuntimes/actionProxy/invoke.py | PacktPublishing/Docker-for-Serverless-Applications | 178101561c3eb676bd771006e145649980965028 | [
"MIT"
] | 11 | 2018-04-20T14:55:41.000Z | 2021-10-02T03:20:08.000Z | ch_openwhisk/openwhisk/actionRuntimes/actionProxy/invoke.py | PacktPublishing/Docker-for-Serverless-Applications | 178101561c3eb676bd771006e145649980965028 | [
"MIT"
] | 2 | 2018-09-29T17:47:28.000Z | 2020-09-29T14:02:38.000Z | ch_openwhisk/openwhisk/actionRuntimes/actionProxy/invoke.py | PacktPublishing/Docker-for-Serverless-Applications | 178101561c3eb676bd771006e145649980965028 | [
"MIT"
] | 5 | 2018-05-13T13:48:07.000Z | 2019-10-24T15:34:13.000Z | #!/usr/bin/env python
"""Executable Python script for testing the action proxy.
This script is useful for testing the action proxy (or its derivatives)
by simulating invoker interactions. Use it in combination with
docker run <image> which starts up the action proxy.
Example:
docker run -i -t -p 8080:8080... | 31.019417 | 104 | 0.613459 |
import os
import re
import sys
import json
import requests
import codecs
DOCKER_HOST = "localhost"
if "DOCKER_HOST" in os.environ:
try:
DOCKER_HOST = re.compile("tcp://(.*):[\d]+").findall(
os.environ["DOCKER_HOST"])[0]
except Exception:
print("cannot determine docker host from %s"... | true | true |
1c0d9bfbd45cb6bf7cd39117c27a0220cb27b1aa | 75 | py | Python | src/JABWrapper/parsers/parser_if.py | igaisin/java-access-bridge-wrapper | 96c61084b94bca67b52b35f4b778b3820f20cd29 | [
"Apache-2.0"
] | 11 | 2021-06-21T14:17:55.000Z | 2022-02-17T12:55:42.000Z | src/JABWrapper/parsers/parser_if.py | igaisin/java-access-bridge-wrapper | 96c61084b94bca67b52b35f4b778b3820f20cd29 | [
"Apache-2.0"
] | 7 | 2021-07-05T08:59:43.000Z | 2021-11-15T09:15:51.000Z | src/JABWrapper/parsers/parser_if.py | igaisin/java-access-bridge-wrapper | 96c61084b94bca67b52b35f4b778b3820f20cd29 | [
"Apache-2.0"
] | 4 | 2021-07-07T09:16:29.000Z | 2021-09-13T11:58:53.000Z | class Parser:
def parse() -> None:
raise NotImplementedError()
| 18.75 | 35 | 0.626667 | class Parser:
def parse() -> None:
raise NotImplementedError()
| true | true |
1c0d9c763f0c1ea98dc92e8cc7c6b73f5a49dbdd | 3,613 | py | Python | ConsistentHashing.py | gudnm/dhash | e63e917f93096c9e8fa0690365de635b6cd2c692 | [
"MIT"
] | 3 | 2016-10-10T16:08:19.000Z | 2020-06-29T07:30:42.000Z | ConsistentHashing.py | gudnm/dhash | e63e917f93096c9e8fa0690365de635b6cd2c692 | [
"MIT"
] | 1 | 2016-09-10T12:51:04.000Z | 2016-09-10T16:28:00.000Z | ConsistentHashing.py | gudnm/dhash | e63e917f93096c9e8fa0690365de635b6cd2c692 | [
"MIT"
] | 3 | 2016-09-08T04:29:44.000Z | 2018-05-06T08:04:38.000Z | from Resizer import Resizer
class ConsistentHashing(Resizer):
"""Implement a consistent hashing ring.
Part of 'Functional Core' - methods of this class don't change
any state or objects, all they do is take values and return values.
E.g. add_node will take new node and all existing nodes and return
... | 35.772277 | 78 | 0.610296 | from Resizer import Resizer
class ConsistentHashing(Resizer):
def __init__(self, nodes):
super(ConsistentHashing, self).__init__()
self.hash_functions = [
self._hash0,
self._hash1,
self._hash2
]
self.positions = []
for node in nodes:
... | true | true |
1c0d9c86c0939b687aa9d32f6e7c3a8162881a2c | 2,479 | py | Python | sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | sdk/storage/azure-storage-blob/azure/storage/blob/_generated/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 42.016949 | 111 | 0.658733 |
from typing import TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
if TYPE_CHECKING:
from typing import Any
VERSION = "unknown"
class AzureBlobStorageConfiguration(Configuration):
def __init__(
self,
url, **kwargs ... | true | true |
1c0d9cbf012d00b0582bb309314b8df4b0530320 | 11,941 | py | Python | neuromake/wildcard.py | UMich-Mind-Lab/neuromake | 325f82ef3ace64dca2871be81fb44d6a58a6925b | [
"MIT"
] | null | null | null | neuromake/wildcard.py | UMich-Mind-Lab/neuromake | 325f82ef3ace64dca2871be81fb44d6a58a6925b | [
"MIT"
] | null | null | null | neuromake/wildcard.py | UMich-Mind-Lab/neuromake | 325f82ef3ace64dca2871be81fb44d6a58a6925b | [
"MIT"
] | null | null | null | """Wildcard class to manage individual wildcard variables"""
from pathlib import Path
import re
from string import Formatter
import neuromake.exceptions as err
class Wildcard():
'''a single variable within a neuromake menu'''
def __init__(self,label,value,metadata={}):
self._set_metadata_defaults()
... | 43.108303 | 141 | 0.587304 | from pathlib import Path
import re
from string import Formatter
import neuromake.exceptions as err
class Wildcard():
def __init__(self,label,value,metadata={}):
self._set_metadata_defaults()
self.set_metadata(**metadata)
self.label = label
self.value = value
def to_dict(self,me... | true | true |
1c0d9e4c1966c0826c9c0f1fbbf4137ea838d342 | 417 | py | Python | jcasts/podcasts/migrations/0119_podcast_feed_queue.py | danjac/jcasts | 04f5ef1f536d51962c0433d092817c0153acb6af | [
"MIT"
] | 13 | 2021-09-17T07:41:00.000Z | 2022-02-10T10:00:48.000Z | jcasts/podcasts/migrations/0119_podcast_feed_queue.py | danjac/jcasts | 04f5ef1f536d51962c0433d092817c0153acb6af | [
"MIT"
] | 167 | 2021-07-17T09:41:38.000Z | 2021-08-31T06:03:34.000Z | jcasts/podcasts/migrations/0119_podcast_feed_queue.py | danjac/jcasts | 04f5ef1f536d51962c0433d092817c0153acb6af | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2021-12-14 22:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("podcasts", "0118_remove_podcast_exception"),
]
operations = [
migrations.AddField(
model_name="podcast",
name="feed_qu... | 21.947368 | 73 | 0.616307 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("podcasts", "0118_remove_podcast_exception"),
]
operations = [
migrations.AddField(
model_name="podcast",
name="feed_queue",
field=models.CharField(blank... | true | true |
1c0d9e5bb96586bf98a45de6fb9313ceb4d90b84 | 1,926 | py | Python | imperative/python/megengine/core/tensor/amp.py | kagome1007/MegEngine | 6814cf1cd7bfae05f1ca22a5b79a09244028c7fd | [
"Apache-2.0"
] | null | null | null | imperative/python/megengine/core/tensor/amp.py | kagome1007/MegEngine | 6814cf1cd7bfae05f1ca22a5b79a09244028c7fd | [
"Apache-2.0"
] | null | null | null | imperative/python/megengine/core/tensor/amp.py | kagome1007/MegEngine | 6814cf1cd7bfae05f1ca22a5b79a09244028c7fd | [
"Apache-2.0"
] | null | null | null | # MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY ... | 23.777778 | 88 | 0.698339 |
from .._imperative_rt.core2 import (
_get_amp_dtype_autocast,
_get_amp_high_prec_dtype,
_get_amp_low_prec_dtype,
_set_amp_dtype_autocast,
_set_amp_high_prec_dtype,
_set_amp_low_prec_dtype,
)
_enabled = False
_set_amp_dtype_autocast(_enabled)
@property
def enabled(mod):
return _enabled
... | true | true |
1c0d9e770958a17fc07d953c779eb95f08cf9ac3 | 2,314 | py | Python | samples/python2/fitline.py | ak352/opencv | a25523311f7648121d3e8ddedc003007910a63c9 | [
"BSD-3-Clause"
] | 29 | 2015-03-23T13:16:42.000Z | 2020-03-06T05:39:02.000Z | samples/python2/fitline.py | ak352/opencv | a25523311f7648121d3e8ddedc003007910a63c9 | [
"BSD-3-Clause"
] | 3 | 2019-02-26T00:14:16.000Z | 2019-02-26T00:14:55.000Z | samples/python2/fitline.py | ak352/opencv | a25523311f7648121d3e8ddedc003007910a63c9 | [
"BSD-3-Clause"
] | 18 | 2015-05-14T01:21:53.000Z | 2022-01-08T06:12:49.000Z | #!/usr/bin/env python
'''
Robust line fitting.
==================
Example of using cv2.fitLine function for fitting line
to points in presence of outliers.
Usage
-----
fitline.py
Switch through different M-estimator functions and see,
how well the robust functions fit the line even
in case of ~50% of outliers.
Key... | 26.597701 | 95 | 0.609767 |
'''
Robust line fitting.
==================
Example of using cv2.fitLine function for fitting line
to points in presence of outliers.
Usage
-----
fitline.py
Switch through different M-estimator functions and see,
how well the robust functions fit the line even
in case of ~50% of outliers.
Keys
----
SPACE - generat... | false | true |
1c0d9ee053c3212fce467646a0089b4205288db2 | 13,785 | py | Python | 1_benchmarking/spinecode/skel.py | ygCoconut/volume2stl | bd95fc39620afd21ce08c8c805ac213583d9daaa | [
"MIT"
] | null | null | null | 1_benchmarking/spinecode/skel.py | ygCoconut/volume2stl | bd95fc39620afd21ce08c8c805ac213583d9daaa | [
"MIT"
] | null | null | null | 1_benchmarking/spinecode/skel.py | ygCoconut/volume2stl | bd95fc39620afd21ce08c8c805ac213583d9daaa | [
"MIT"
] | null | null | null | import os
import collections
from collections import namedtuple
import scipy.sparse as sp
from scipy.sparse import csgraph
from scipy.spatial import KDTree
from scipy.ndimage.morphology import distance_transform_edt
import numpy as np
import h5py
import kimimaro
import cloudvolume as cv
from . import u
FakeSkeleton... | 32.05814 | 78 | 0.628001 | import os
import collections
from collections import namedtuple
import scipy.sparse as sp
from scipy.sparse import csgraph
from scipy.spatial import KDTree
from scipy.ndimage.morphology import distance_transform_edt
import numpy as np
import h5py
import kimimaro
import cloudvolume as cv
from . import u
FakeSkeleton... | true | true |
1c0d9f1621fb4a968b327b30f666b4332b1aae84 | 10,084 | py | Python | python_modules/libraries/dagster-airflow/dagster_airflow/operators/kubernetes_operator.py | johannkm/dagster-okteto | 7ad30528a4a92945967d68e59e27727a1e839c2b | [
"Apache-2.0"
] | 1 | 2020-08-10T23:03:37.000Z | 2020-08-10T23:03:37.000Z | python_modules/libraries/dagster-airflow/dagster_airflow/operators/kubernetes_operator.py | johannkm/dagster-okteto | 7ad30528a4a92945967d68e59e27727a1e839c2b | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-airflow/dagster_airflow/operators/kubernetes_operator.py | johannkm/dagster-okteto | 7ad30528a4a92945967d68e59e27727a1e839c2b | [
"Apache-2.0"
] | 1 | 2020-08-20T14:20:31.000Z | 2020-08-20T14:20:31.000Z | import sys
import time
from airflow.contrib.kubernetes import kube_client, pod_generator, pod_launcher
from airflow.exceptions import AirflowException
from airflow.utils.state import State
from dagster_airflow.vendor.kubernetes_pod_operator import KubernetesPodOperator
from dagster_graphql.client.query import RAW_EXEC... | 40.175299 | 99 | 0.6071 | import sys
import time
from airflow.contrib.kubernetes import kube_client, pod_generator, pod_launcher
from airflow.exceptions import AirflowException
from airflow.utils.state import State
from dagster_airflow.vendor.kubernetes_pod_operator import KubernetesPodOperator
from dagster_graphql.client.query import RAW_EXEC... | true | true |
1c0d9f9889b42d81d22dee507c5f711b8ae1def8 | 4,726 | py | Python | recsys/svd_pp/model.py | zakharovas/RecSys2018 | f58ed6716213267ad2cde30d1ff677abc5da96ba | [
"Apache-2.0"
] | 8 | 2018-07-02T22:46:37.000Z | 2021-03-26T08:30:22.000Z | recsys/svd_pp/model.py | zakharovas/RecSys2018 | f58ed6716213267ad2cde30d1ff677abc5da96ba | [
"Apache-2.0"
] | null | null | null | recsys/svd_pp/model.py | zakharovas/RecSys2018 | f58ed6716213267ad2cde30d1ff677abc5da96ba | [
"Apache-2.0"
] | 3 | 2018-07-23T04:21:16.000Z | 2021-05-22T11:47:21.000Z | import tensorflow as tf
import numpy as np
from json import loads
from json import dumps
from tqdm import tqdm
from itertools import count
from functools import partial
# Model params:
user_count = 17259
item_count = 2149247
batch_size = 10000
factor_dim = 32
# Dataset initialization:
def generator(filenames):
... | 29.911392 | 79 | 0.578079 | import tensorflow as tf
import numpy as np
from json import loads
from json import dumps
from tqdm import tqdm
from itertools import count
from functools import partial
user_count = 17259
item_count = 2149247
batch_size = 10000
factor_dim = 32
def generator(filenames):
for filename in filenames:
wit... | true | true |
1c0da0c872723466599279351900bd3fc0f034f0 | 849 | py | Python | tests/test_layers/test_embedding.py | gzcf/polyaxon-schemas | a381280cd7535f64158d52f0a9eff2afec997d90 | [
"MIT"
] | null | null | null | tests/test_layers/test_embedding.py | gzcf/polyaxon-schemas | a381280cd7535f64158d52f0a9eff2afec997d90 | [
"MIT"
] | null | null | null | tests/test_layers/test_embedding.py | gzcf/polyaxon-schemas | a381280cd7535f64158d52f0a9eff2afec997d90 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from unittest import TestCase
from tests.utils import assert_equal_layers
from polyaxon_schemas.initializations import UniformInitializerConfig
from polyaxon_schemas.layers.embeddings import EmbeddingConfig
class TestEmbedding... | 32.653846 | 77 | 0.69258 | from __future__ import absolute_import, division, print_function
from unittest import TestCase
from tests.utils import assert_equal_layers
from polyaxon_schemas.initializations import UniformInitializerConfig
from polyaxon_schemas.layers.embeddings import EmbeddingConfig
class TestEmbeddingConfigs(TestCase):
d... | true | true |
1c0da0ee9104219d234debc3b388fb006954ce1c | 124,804 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ifmgr_oper.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ifmgr_oper.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ifmgr_oper.py | tkamata-test/ydk-py | b637e7853a8edbbd31fbc05afa3aa4110b31c5f9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """ Cisco_IOS_XR_ifmgr_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR ifmgr package operational data.
This module contains definitions
for the following management objects\:
interface\-dampening\: Interface dampening data
interface\-properties\: interface properties
Copyright (c) 2... | 42.697229 | 309 | 0.406622 |
import re
import collections
from enum import Enum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk.errors import YPYError, YPYModelError
class ImStateEnumEnum(Enum):
im_state_not_ready = 0
im_state_admin_down = 1
im_state_down = 2
im_state_up = 3
... | true | true |
1c0da27d5b812075c05b410659d1e456180c4def | 746 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py | e-dang/cookiecutter-django | 2ba986296de1d5a086e73cde746d6fc7366f149c | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py | e-dang/cookiecutter-django | 2ba986296de1d5a086e73cde746d6fc7366f149c | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/forms.py | e-dang/cookiecutter-django | 2ba986296de1d5a086e73cde746d6fc7366f149c | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.auth import forms as admin_forms
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
User = get_user_model()
class UserChangeForm(admin_forms.UserChangeForm):
class Meta(admin_forms.UserChangeForm.Meta):
model = User
class UserCreati... | 33.909091 | 134 | 0.69437 | from django.contrib.auth import forms as admin_forms
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
User = get_user_model()
class UserChangeForm(admin_forms.UserChangeForm):
class Meta(admin_forms.UserChangeForm.Meta):
model = User
class UserCreati... | false | true |
1c0da2de6b8f1bb0338f45fdb3e18c65d1545c8f | 657 | py | Python | jadepunk/aspects.py | HarkonenBade/jadepunk-chargen | 198590946b7192e78967de0788da4009f8454dd5 | [
"MIT"
] | 1 | 2020-05-28T13:06:43.000Z | 2020-05-28T13:06:43.000Z | jadepunk/aspects.py | HarkonenBade/jadepunk-chargen | 198590946b7192e78967de0788da4009f8454dd5 | [
"MIT"
] | null | null | null | jadepunk/aspects.py | HarkonenBade/jadepunk-chargen | 198590946b7192e78967de0788da4009f8454dd5 | [
"MIT"
] | null | null | null | import enum
class AspectTypes(enum.Enum):
PORTRAYAL = "Portrayal"
BACKGROUND = "Background"
INCITING_INCIDENT = "Inciting Incident"
BELIEF = "Belief"
TROUBLE = "Trouble"
class Aspects(object):
def __init__(self, **kwargs):
self.aspects = {AspectTypes[asp.upper()]: val for asp, val in... | 26.28 | 85 | 0.622527 | import enum
class AspectTypes(enum.Enum):
PORTRAYAL = "Portrayal"
BACKGROUND = "Background"
INCITING_INCIDENT = "Inciting Incident"
BELIEF = "Belief"
TROUBLE = "Trouble"
class Aspects(object):
def __init__(self, **kwargs):
self.aspects = {AspectTypes[asp.upper()]: val for asp, val in... | true | true |
1c0da34bd61a90d1ec00b251bb8b70659c58241f | 233 | py | Python | core/controllers/__init__.py | tzakrajs/yaiges | 046e376dc7a03466cf2860cf29509d251ed667e3 | [
"Apache-2.0"
] | null | null | null | core/controllers/__init__.py | tzakrajs/yaiges | 046e376dc7a03466cf2860cf29509d251ed667e3 | [
"Apache-2.0"
] | null | null | null | core/controllers/__init__.py | tzakrajs/yaiges | 046e376dc7a03466cf2860cf29509d251ed667e3 | [
"Apache-2.0"
] | null | null | null | import os
import glob
# This trick overrides the controller modules __all__ attribute and includes
# the modules inside the controllers path
__all__ = [ os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__)+"/*.py")] | 38.833333 | 91 | 0.759657 | import os
import glob
__all__ = [ os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__)+"/*.py")] | true | true |
1c0da363a78593c7756607b25ce8127cfb54ab68 | 2,189 | py | Python | module2-sql-for-analysis/titanic.py | ndow33/DS-Unit-3-Sprint-2-SQL-and-Databases | 14cfe850e68e134057fe56c1fea99c32c4473859 | [
"MIT"
] | null | null | null | module2-sql-for-analysis/titanic.py | ndow33/DS-Unit-3-Sprint-2-SQL-and-Databases | 14cfe850e68e134057fe56c1fea99c32c4473859 | [
"MIT"
] | null | null | null | module2-sql-for-analysis/titanic.py | ndow33/DS-Unit-3-Sprint-2-SQL-and-Databases | 14cfe850e68e134057fe56c1fea99c32c4473859 | [
"MIT"
] | null | null | null | import os
import psycopg2
from psycopg2.extras import DictCursor
from psycopg2.extras import execute_values
from dotenv import load_dotenv
import pandas as pd
import json
import numpy as np
load_dotenv() # reads the contents of the .env file and adds them to the environment
psycopg2.extensions.register_adapter(np.int... | 27.3625 | 134 | 0.725445 | import os
import psycopg2
from psycopg2.extras import DictCursor
from psycopg2.extras import execute_values
from dotenv import load_dotenv
import pandas as pd
import json
import numpy as np
load_dotenv()
psycopg2.extensions.register_adapter(np.int64, psycopg2._psycopg.AsIs)
DB_NAME = os.getenv("DB_NAME", default = "... | true | true |
1c0da3ef57a6ab0a5d9f4e3b9735e180f7e3c16b | 1,505 | py | Python | philomath/service.py | arasheedu/philomath | bf3163e029eb50b81bacff13bbe90043d6959f8a | [
"MIT"
] | 1 | 2019-02-17T16:35:52.000Z | 2019-02-17T16:35:52.000Z | philomath/service.py | arasheedu/philomath | bf3163e029eb50b81bacff13bbe90043d6959f8a | [
"MIT"
] | null | null | null | philomath/service.py | arasheedu/philomath | bf3163e029eb50b81bacff13bbe90043d6959f8a | [
"MIT"
] | null | null | null | import falcon
import scrapy
import settings
import logging
import threading
import subprocess
import crawlthread
import urllib2
from multiprocessing import Process, Queue
from elasticsearch import Elasticsearch, helpers
from scrapy.crawler import CrawlerRunner
from scrapy.utils.log import configure_logging
from twiste... | 32.717391 | 101 | 0.671761 | import falcon
import scrapy
import settings
import logging
import threading
import subprocess
import crawlthread
import urllib2
from multiprocessing import Process, Queue
from elasticsearch import Elasticsearch, helpers
from scrapy.crawler import CrawlerRunner
from scrapy.utils.log import configure_logging
from twiste... | true | true |
1c0da3f1e8b744dc309f34f2b36ebe4ed0146045 | 6,037 | py | Python | resto_client_tests/tv/cli/vtest_download.py | CNES/resto_client | 7048bd79c739e33882ebd664790dcf0528e81aa4 | [
"Apache-2.0"
] | 6 | 2019-12-20T09:12:30.000Z | 2021-07-08T11:44:55.000Z | resto_client_tests/tv/cli/vtest_download.py | CNES/resto_client | 7048bd79c739e33882ebd664790dcf0528e81aa4 | [
"Apache-2.0"
] | null | null | null | resto_client_tests/tv/cli/vtest_download.py | CNES/resto_client | 7048bd79c739e33882ebd664790dcf0528e81aa4 | [
"Apache-2.0"
] | 1 | 2019-12-17T20:16:39.000Z | 2019-12-17T20:16:39.000Z | # -*- coding: utf-8 -*-
"""
.. admonition:: License
Copyright 2019 CNES
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 requir... | 49.081301 | 100 | 0.618685 | from resto_client.base_exceptions import RestoClientUserError, AccessDeniedError
from resto_client.cli.resto_client_cli import resto_client_run
from resto_client_tests.resto_client_cli_test import TestRestoClientCli
class VTestCliDownload(TestRestoClientCli):
def test_n_download_annexes(self) -> None:
co... | true | true |
1c0da431d92fedf9dcd0aa789443998cae75ad60 | 1,629 | py | Python | opencivicdata/core/admin/base.py | california-civic-data-coalition/python-opencivicdata-django | 375cd09d48908a7be58186de64f470b233f616d6 | [
"BSD-3-Clause"
] | 1 | 2017-11-03T14:54:16.000Z | 2017-11-03T14:54:16.000Z | opencivicdata/core/admin/base.py | california-civic-data-coalition/python-opencivicdata | 375cd09d48908a7be58186de64f470b233f616d6 | [
"BSD-3-Clause"
] | 4 | 2017-08-16T21:00:14.000Z | 2017-12-21T03:16:11.000Z | opencivicdata/core/admin/base.py | california-civic-data-coalition/python-opencivicdata-django | 375cd09d48908a7be58186de64f470b233f616d6 | [
"BSD-3-Clause"
] | 1 | 2022-01-14T02:24:17.000Z | 2022-01-14T02:24:17.000Z | from django.contrib import admin
# Helpers ##########
class ModelAdmin(admin.ModelAdmin):
""" deletion of top level objects is evil """
actions = None
def has_delete_permission(self, request, obj=None):
return False
# we probably don't want to add anything through the interface
def has... | 24.681818 | 66 | 0.696133 | from django.contrib import admin
class ModelAdmin(admin.ModelAdmin):
actions = None
def has_delete_permission(self, request, obj=None):
return False
def has_add_permission(self, request, obj=None):
return False
# To ignore `DisallowedModelAdminLookup` error because of non
... | true | true |
1c0da513ec891257dd54ed080fc3f40961a06dfb | 2,330 | py | Python | azure-mgmt-signalr/azure/mgmt/signalr/models/resource_sku_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | null | null | null | azure-mgmt-signalr/azure/mgmt/signalr/models/resource_sku_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-11-29T14:46:42.000Z | 2018-11-29T14:46:42.000Z | azure-mgmt-signalr/azure/mgmt/signalr/models/resource_sku_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2018-08-28T14:36:47.000Z | 2018-08-28T14:36:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 40.172414 | 120 | 0.612876 |
from msrest.serialization import Model
class ResourceSku(Model):
_validation = {
'name': {'required': True},
}
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'tier': {'key': 'tier', 'type': 'str'},
'size': {'key': 'size', 'type': 'str'},
'family': {'k... | true | true |
1c0da6275f44732d06f286691c5097920f884b79 | 1,203 | py | Python | clustering/clustering.py | Noonewin/ML_scripts | a7019a2c8f138f3622979afd05d435dbeb319f15 | [
"MIT"
] | null | null | null | clustering/clustering.py | Noonewin/ML_scripts | a7019a2c8f138f3622979afd05d435dbeb319f15 | [
"MIT"
] | 2 | 2021-04-06T15:51:37.000Z | 2021-06-04T18:06:18.000Z | clustering/clustering.py | tyanakiev/ML_scripts | a7019a2c8f138f3622979afd05d435dbeb319f15 | [
"MIT"
] | null | null | null | import os
import sys
import scipy as sp
from matplotlib.mlab import dist
from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer(min_df=1)
# content = ["How to format my hard disk", " Hard disk format problems "]
# X = vectorizer.fit_transform(content)
# print(vectorizer.get_feature_n... | 24.55102 | 73 | 0.704073 | import os
import sys
import scipy as sp
from matplotlib.mlab import dist
from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer(min_df=1)
DIR = "./data"
posts = [open(os.path.join(DIR, f)).read() for f in os.listdir(DIR)]
print(posts)
X_train = vectorizer.fit_transform(posts)
num_sa... | true | true |
1c0da63f031c9b1d82cf4ec23f48d35b46abfd80 | 1,287 | py | Python | index_microservice.py | scissorhands/pynal | 2a4f89da405696d6d53a88b437de065978235838 | [
"MIT"
] | null | null | null | index_microservice.py | scissorhands/pynal | 2a4f89da405696d6d53a88b437de065978235838 | [
"MIT"
] | null | null | null | index_microservice.py | scissorhands/pynal | 2a4f89da405696d6d53a88b437de065978235838 | [
"MIT"
] | null | null | null | from requester import Requester
import json
req = Requester()
localTest = False
print('Loading function')
def respond(err, res=None):
return {
'statusCode': '400' if err else '200',
'body': err.message if err else json.dumps(res),
'headers': {
'Content-Type': 'application/json... | 25.235294 | 84 | 0.56488 | from requester import Requester
import json
req = Requester()
localTest = False
print('Loading function')
def respond(err, res=None):
return {
'statusCode': '400' if err else '200',
'body': err.message if err else json.dumps(res),
'headers': {
'Content-Type': 'application/json... | true | true |
1c0da668459abc74cb0cd67f1e90dd10a6dc082c | 3,359 | py | Python | tests/test_fake_fastnumbers.py | altendky/natsort | 3fd3585a7ed0150f03adbf8ee77c342da53f6aac | [
"MIT"
] | null | null | null | tests/test_fake_fastnumbers.py | altendky/natsort | 3fd3585a7ed0150f03adbf8ee77c342da53f6aac | [
"MIT"
] | null | null | null | tests/test_fake_fastnumbers.py | altendky/natsort | 3fd3585a7ed0150f03adbf8ee77c342da53f6aac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""\
Test the fake fastnumbers module.
"""
from __future__ import unicode_literals
import unicodedata
from math import isnan
from hypothesis import given
from hypothesis.strategies import floats, integers, text
from natsort.compat.fake_fastnumbers import fast_float, fast_int
from natsort.compa... | 24.165468 | 67 | 0.681453 | from __future__ import unicode_literals
import unicodedata
from math import isnan
from hypothesis import given
from hypothesis.strategies import floats, integers, text
from natsort.compat.fake_fastnumbers import fast_float, fast_int
from natsort.compat.py23 import PY_VERSION
if PY_VERSION >= 3:
long = int
def ... | true | true |
1c0da6ca4582343448fa44d0b73504234cfe8f9c | 243 | py | Python | dtconvert/test/test_utils.py | tinnuadan/redcogs | 7a3cf31e39a7a024e6ee0faf68c9ca7943dfce3e | [
"MIT"
] | 1 | 2020-09-14T06:43:03.000Z | 2020-09-14T06:43:03.000Z | dtconvert/test/test_utils.py | tinnuadan/redcogs | 7a3cf31e39a7a024e6ee0faf68c9ca7943dfce3e | [
"MIT"
] | null | null | null | dtconvert/test/test_utils.py | tinnuadan/redcogs | 7a3cf31e39a7a024e6ee0faf68c9ca7943dfce3e | [
"MIT"
] | null | null | null | from ..src import utils
import datetime
from .helpers import getTimezones
def testToUnixTime():
tzinfo = getTimezones().getTzInfo("CEST")
dt = datetime.datetime(2019, 7, 14, 12, 0,0, 0, tzinfo)
assert utils.toUnixTime(dt) == 1563098400 | 27 | 57 | 0.73251 | from ..src import utils
import datetime
from .helpers import getTimezones
def testToUnixTime():
tzinfo = getTimezones().getTzInfo("CEST")
dt = datetime.datetime(2019, 7, 14, 12, 0,0, 0, tzinfo)
assert utils.toUnixTime(dt) == 1563098400 | true | true |
1c0da96675c253ce3c9d778e9c9bf065af6dd992 | 77 | py | Python | waveAnalysis/testss.py | Junjun1guo/seismicWaveAnalysis | fc29ecaa212906d630b311261a6cabb8de56150d | [
"MIT"
] | 5 | 2019-11-11T03:36:55.000Z | 2021-04-07T06:43:36.000Z | seismicWaveAnalysis/testss.py | Junjun1guo/jupyterLabBasedPythonLearning | bbee9069dcced6ae7c2693e5a1eefea897cb98a3 | [
"MIT"
] | null | null | null | seismicWaveAnalysis/testss.py | Junjun1guo/jupyterLabBasedPythonLearning | bbee9069dcced6ae7c2693e5a1eefea897cb98a3 | [
"MIT"
] | 3 | 2020-06-02T15:11:07.000Z | 2022-02-20T07:52:11.000Z | import mainView
app=wx.App()
frame=baseView()
frame.Show(True)
app.MainLoop() | 15.4 | 16 | 0.766234 | import mainView
app=wx.App()
frame=baseView()
frame.Show(True)
app.MainLoop() | true | true |
1c0da981c2332fd8d26cb28bb876cb0817220df4 | 5,657 | py | Python | lib/galaxy/web/framework/middleware/profile.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 4 | 2015-05-12T20:36:41.000Z | 2017-06-26T15:34:02.000Z | lib/galaxy/web/framework/middleware/profile.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 72 | 2019-06-06T18:52:41.000Z | 2022-02-17T02:53:18.000Z | lib/galaxy/web/framework/middleware/profile.py | rikeshi/galaxy | c536a877e4a9b3d12aa0d00fd4d5e705109a0d0a | [
"CC-BY-3.0"
] | 1 | 2016-03-21T12:54:06.000Z | 2016-03-21T12:54:06.000Z | """
Middleware that profiles the request with cProfile and displays profiling
information at the bottom of each page.
"""
import cProfile
import pstats
import threading
import markupsafe
from paste import response
template = """
<script>
function show_profile_output()
{
var win = window.open("", "win"); // a window ... | 32.325714 | 128 | 0.587237 | import cProfile
import pstats
import threading
import markupsafe
from paste import response
template = """
<script>
function show_profile_output()
{
var win = window.open("", "win"); // a window object
var doc = win.document;
doc.open("text/html", "replace");
doc.write("<HTML><HEAD><TITLE>Profiler output</TITLE></HE... | true | true |
1c0da9ebcab6efe9c7b989f546860c4d37c62554 | 2,888 | py | Python | x_tef/test_bulk_calc.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | 4 | 2015-06-09T18:53:11.000Z | 2021-08-19T01:39:38.000Z | x_tef/test_bulk_calc.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | null | null | null | x_tef/test_bulk_calc.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | 1 | 2017-03-07T01:28:49.000Z | 2017-03-07T01:28:49.000Z | # -*- coding: utf-8 -*-
"""
Code to test the bulk_calc code.
"""
import os
import sys
alp = os.path.abspath('../alpha')
if alp not in sys.path:
sys.path.append(alp)
import Lfun
import zfun
Ldir = Lfun.Lstart()
import numpy as np
import pickle
import matplotlib.pyplot as plt
import tef_fun_lorenz as tfl
from impo... | 26.495413 | 89 | 0.629155 |
import os
import sys
alp = os.path.abspath('../alpha')
if alp not in sys.path:
sys.path.append(alp)
import Lfun
import zfun
Ldir = Lfun.Lstart()
import numpy as np
import pickle
import matplotlib.pyplot as plt
import tef_fun_lorenz as tfl
from importlib import reload
reload(tfl)
Ldir = Lfun.Lstart()
indir0 = Ld... | true | true |
1c0daa2100ffe1e9d0ba3dad3a66c415e144047a | 12,593 | py | Python | wallee/models/payment_app_connector_creation_request.py | wallee-payment/python-sdk | 43396e4ebb76535d6916e8a1422a58c674e19d32 | [
"Apache-2.0"
] | 2 | 2020-01-16T13:24:06.000Z | 2020-11-21T17:40:17.000Z | wallee/models/payment_app_connector_creation_request.py | wallee-payment/python-sdk | 43396e4ebb76535d6916e8a1422a58c674e19d32 | [
"Apache-2.0"
] | 4 | 2019-10-14T17:33:23.000Z | 2021-10-01T14:49:11.000Z | wallee/models/payment_app_connector_creation_request.py | wallee-payment/python-sdk | 43396e4ebb76535d6916e8a1422a58c674e19d32 | [
"Apache-2.0"
] | 2 | 2019-10-15T14:17:10.000Z | 2021-09-17T13:07:09.000Z | # coding: utf-8
import pprint
import six
from enum import Enum
class PaymentAppConnectorCreationRequest:
swagger_types = {
'authorization_timeout_in_minutes': 'int',
'completion_configuration': 'PaymentAppCompletionConfigurationCreate',
'connector': 'int',
'external_id': 'st... | 41.288525 | 338 | 0.697213 | import pprint
import six
from enum import Enum
class PaymentAppConnectorCreationRequest:
swagger_types = {
'authorization_timeout_in_minutes': 'int',
'completion_configuration': 'PaymentAppCompletionConfigurationCreate',
'connector': 'int',
'external_id': 'str',
'nam... | true | true |
1c0daae3f8d902e4d032a9cc991fb99e344ecf96 | 460 | py | Python | examples/python/cpu/tensors/ocean_bitshift_01.py | kant/ocean-tensor-package | fb3fcff8bba7f4ef6cd8b8d02f0e1be1258da02d | [
"Apache-2.0"
] | 27 | 2018-08-16T21:32:49.000Z | 2021-11-30T10:31:08.000Z | examples/python/cpu/tensors/ocean_bitshift_01.py | kant/ocean-tensor-package | fb3fcff8bba7f4ef6cd8b8d02f0e1be1258da02d | [
"Apache-2.0"
] | null | null | null | examples/python/cpu/tensors/ocean_bitshift_01.py | kant/ocean-tensor-package | fb3fcff8bba7f4ef6cd8b8d02f0e1be1258da02d | [
"Apache-2.0"
] | 13 | 2018-08-17T17:33:16.000Z | 2021-11-30T10:31:09.000Z | import pyOcean_cpu as ocean
device = ocean.cpu
dtypes = [ocean.bool, ocean.int8, ocean.uint8, ocean.uint32]
for dtype in dtypes :
print("\n========= Tensor %s (%s) =========" % (dtype.name, device.name))
a = ocean.asTensor([0,1,2,9],'r',dtype,device)
b = ocean.asTensor([0,1,2,4,6,8],ocean.uint8,device)
r ... | 25.555556 | 76 | 0.6 | import pyOcean_cpu as ocean
device = ocean.cpu
dtypes = [ocean.bool, ocean.int8, ocean.uint8, ocean.uint32]
for dtype in dtypes :
print("\n========= Tensor %s (%s) =========" % (dtype.name, device.name))
a = ocean.asTensor([0,1,2,9],'r',dtype,device)
b = ocean.asTensor([0,1,2,4,6,8],ocean.uint8,device)
r ... | true | true |
1c0daaee002c2e499421546ec026ffb3a7511049 | 517 | py | Python | rest_api/project/core/migrations/0008_auto_20200126_2111.py | Razz21/Nuxt-Django-E-Commerce-Demo | 24834007f7554f9e59758b611c73ea0da85c841e | [
"MIT"
] | 1 | 2020-10-31T12:46:17.000Z | 2020-10-31T12:46:17.000Z | rest_api/project/core/migrations/0008_auto_20200126_2111.py | Razz21/Nuxt-Django-E-Commerce-Demo | 24834007f7554f9e59758b611c73ea0da85c841e | [
"MIT"
] | 2 | 2020-07-25T11:01:46.000Z | 2022-01-22T10:39:02.000Z | rest_api/project/core/migrations/0008_auto_20200126_2111.py | Razz21/Nuxt-Django-E-Commerce-Demo | 24834007f7554f9e59758b611c73ea0da85c841e | [
"MIT"
] | null | null | null | # Generated by Django 2.2.9 on 2020-01-26 20:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20200122_1450'),
]
operations = [
migrations.RemoveField(
model_name='item',
name='category',
... | 22.478261 | 83 | 0.576402 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0007_auto_20200122_1450'),
]
operations = [
migrations.RemoveField(
model_name='item',
name='category',
),
migrations.AddField(
... | true | true |
1c0dac590aa6b0fb49ad96537781faa811860c02 | 45,396 | py | Python | protos/center_net_pb2.py | wastelander47/TransferLearningbyObjectDetectionAPI | 9e2cb064f09f6a91542f1b40606d18e340c90253 | [
"Apache-2.0"
] | null | null | null | protos/center_net_pb2.py | wastelander47/TransferLearningbyObjectDetectionAPI | 9e2cb064f09f6a91542f1b40606d18e340c90253 | [
"Apache-2.0"
] | null | null | null | protos/center_net_pb2.py | wastelander47/TransferLearningbyObjectDetectionAPI | 9e2cb064f09f6a91542f1b40606d18e340c90253 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/center_net.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import s... | 57.609137 | 4,821 | 0.781721 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from object_detection.protos import image_resizer_pb2 as ob... | true | true |
1c0dae95301935eb698bd1140dc5d956f8b4c6bb | 8,688 | py | Python | model/stashCart.py | voteview/WebVoteView | 9eadef289f2f0d163ed8192957a8b190e1dbd884 | [
"MIT"
] | 23 | 2018-03-05T16:05:33.000Z | 2021-12-24T16:09:18.000Z | model/stashCart.py | JeffreyBLewis/WebVoteView | 9eadef289f2f0d163ed8192957a8b190e1dbd884 | [
"MIT"
] | 267 | 2016-06-22T23:53:19.000Z | 2018-01-03T20:16:09.000Z | model/stashCart.py | JeffreyBLewis/WebVoteView | 9eadef289f2f0d163ed8192957a8b190e1dbd884 | [
"MIT"
] | 2 | 2016-08-11T20:50:34.000Z | 2016-10-28T00:59:23.000Z | import json
import pymongo
import re
import uuid
import time
from searchVotes import query
client = pymongo.MongoClient()
# Swear filter is a combination of:
# https://gist.github.com/jamiew/1112488
# https://gist.github.com/tjrobinson/2366772
try:
swearData = json.load(open("swearFilter.json","r"))["swears"]
dbCon... | 25.552941 | 141 | 0.645258 | import json
import pymongo
import re
import uuid
import time
from searchVotes import query
client = pymongo.MongoClient()
try:
swearData = json.load(open("swearFilter.json","r"))["swears"]
dbConf = json.load(open("db.json","r"))
db = client[dbConf["dbname"]]
except:
try:
swearData = json.load(open("./model/swea... | false | true |
1c0daf7392cd943662ccbaa0cd16562bffad62f8 | 10,673 | py | Python | tools/_12_XSWatershedArea.py | FluvialGeomorph/FluvialGeomorph-toolbox | d7b0712d4841af5cc341443d695bf0481eeccb23 | [
"CC0-1.0"
] | null | null | null | tools/_12_XSWatershedArea.py | FluvialGeomorph/FluvialGeomorph-toolbox | d7b0712d4841af5cc341443d695bf0481eeccb23 | [
"CC0-1.0"
] | 1 | 2021-03-25T12:38:23.000Z | 2021-03-25T12:38:23.000Z | tools/_12_XSWatershedArea.py | FluvialGeomorph/FluvialGeomorph-toolbox | d7b0712d4841af5cc341443d695bf0481eeccb23 | [
"CC0-1.0"
] | null | null | null | """____________________________________________________________________________
Script Name: _12_XSWatershedArea.py
Description: Adds watershed area to each cross section.
Date: 10/24/2019
Usage:
Calculates the watershed area upstream of the input cross section. Writes the
value to a ... | 45.806867 | 83 | 0.576127 |
import os
import arcpy
def XSWatershedArea(output_workspace, cross_section, flowline, flow_accum,
snap_distance):
arcpy.CheckOutExtension("Spatial")
arcpy.env.overwriteOutput = True
arcpy.env.workspace = output_workspace
arcpy.env.scratchWorkspace = output_workspace
... | true | true |
1c0dafe009e771809ecf28a5f5325c9e34a98d8b | 3,545 | py | Python | carceral/trend_with_rate.py | milwaukee-city-data/budget | 1e07b72d0d58abf2e2dcef875d52e1a2af07b252 | [
"MIT"
] | 2 | 2021-06-26T20:05:50.000Z | 2021-06-26T20:41:28.000Z | carceral/trend_with_rate.py | milwaukee-city-data/budget | 1e07b72d0d58abf2e2dcef875d52e1a2af07b252 | [
"MIT"
] | null | null | null | carceral/trend_with_rate.py | milwaukee-city-data/budget | 1e07b72d0d58abf2e2dcef875d52e1a2af07b252 | [
"MIT"
] | null | null | null | import csv
import os
from scipy.signal import savgol_filter
from gwpy.time import to_gps
from gwpy.timeseries import TimeSeries
from matplotlib import use
use("Agg")
from matplotlib import font_manager, pyplot, rcParams
# set font properties
font_dir = os.path.join(os.environ["HOME"], "Downloads", "vollkorn")
for... | 26.259259 | 71 | 0.550917 | import csv
import os
from scipy.signal import savgol_filter
from gwpy.time import to_gps
from gwpy.timeseries import TimeSeries
from matplotlib import use
use("Agg")
from matplotlib import font_manager, pyplot, rcParams
font_dir = os.path.join(os.environ["HOME"], "Downloads", "vollkorn")
for font in font_manager.... | true | true |
1c0db0be154d585e0a6d1514558e116ee83c9701 | 3,829 | py | Python | python/paddle/fluid/tests/custom_op/test_custom_op.py | OuyangChao/Paddle | cac9635a6733ffbbd816b33e21c3054e0cd81ab1 | [
"Apache-2.0"
] | 2 | 2021-02-04T15:04:21.000Z | 2021-02-07T14:20:00.000Z | python/paddle/fluid/tests/custom_op/test_custom_op.py | OuyangChao/Paddle | cac9635a6733ffbbd816b33e21c3054e0cd81ab1 | [
"Apache-2.0"
] | 1 | 2021-03-14T15:24:46.000Z | 2021-03-14T15:24:46.000Z | python/paddle/fluid/tests/custom_op/test_custom_op.py | OuyangChao/Paddle | cac9635a6733ffbbd816b33e21c3054e0cd81ab1 | [
"Apache-2.0"
] | 1 | 2021-03-16T13:40:08.000Z | 2021-03-16T13:40:08.000Z | # Copyright (c) 2019 PaddlePaddle 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 appli... | 31.644628 | 77 | 0.667015 |
import os
import sys
import numpy as np
import unittest
import contextlib
import paddle
import paddle.fluid as fluid
paddle.enable_static()
def load_so(so_name):
file_dir = os.path.dirname(os.path.abspath(__file__))
fluid.load_op_library(os.path.join(file_dir, so_name))
from paddle.fluid.layer_helper impo... | true | true |
1c0db10d9a999fed291216cc63dce825d3e22ca6 | 8,770 | py | Python | lte/gateway/python/magma/enodebd/data_models/data_model.py | nitinneet/test23 | c44df1a3290195cd3fc59d3483ef640ca8aaeb1e | [
"BSD-3-Clause"
] | 1 | 2021-08-08T15:49:05.000Z | 2021-08-08T15:49:05.000Z | lte/gateway/python/magma/enodebd/data_models/data_model.py | nitinneet/test23 | c44df1a3290195cd3fc59d3483ef640ca8aaeb1e | [
"BSD-3-Clause"
] | 143 | 2020-09-08T06:24:23.000Z | 2022-03-29T05:56:53.000Z | lte/gateway/python/magma/enodebd/data_models/data_model.py | nitinneet/test23 | c44df1a3290195cd3fc59d3483ef640ca8aaeb1e | [
"BSD-3-Clause"
] | 2 | 2021-05-27T18:15:16.000Z | 2021-05-27T18:41:39.000Z | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 33.473282 | 79 | 0.642645 |
from abc import ABC, abstractmethod
from collections import namedtuple
from typing import Any, Callable, Dict, List, Optional
from magma.enodebd.data_models.data_model_parameters import ParameterName
TrParam = namedtuple('TrParam', ['path', 'is_invasive', 'type', 'is_optional'])
class DataModel(ABC):
def __in... | true | true |
1c0db12996f271a2dfe98d49b5a8f67ec2321c1a | 219,901 | py | Python | 7.30.1.dev0/ietf/meeting/tests_views.py | kesara/ietf-datatracker | dca3ee2ee98bcb75a10687587cf631750be34c79 | [
"Unlicense"
] | null | null | null | 7.30.1.dev0/ietf/meeting/tests_views.py | kesara/ietf-datatracker | dca3ee2ee98bcb75a10687587cf631750be34c79 | [
"Unlicense"
] | null | null | null | 7.30.1.dev0/ietf/meeting/tests_views.py | kesara/ietf-datatracker | dca3ee2ee98bcb75a10687587cf631750be34c79 | [
"Unlicense"
] | null | null | null | # Copyright The IETF Trust 2009-2020, All Rights Reserved
# -*- coding: utf-8 -*-
import datetime
import io
import json
import os
import random
import re
import shutil
from unittest import skipIf
from mock import patch
from pyquery import PyQuery
from io import StringIO, BytesIO
from bs4 import BeautifulSoup
from ur... | 50.750288 | 199 | 0.644294 |
import datetime
import io
import json
import os
import random
import re
import shutil
from unittest import skipIf
from mock import patch
from pyquery import PyQuery
from io import StringIO, BytesIO
from bs4 import BeautifulSoup
from urllib.parse import urlparse, urlsplit
from django.urls import reverse as urlrevers... | true | true |
1c0db1a0c9bfe595de106601c8358d9bbfce11b5 | 1,425 | py | Python | tests/test_pyliquibase.py | memiiso/pyliquibase | c9aa577a7f685888ae389416f8d41faa04a2152e | [
"Apache-2.0"
] | 6 | 2021-02-23T10:00:33.000Z | 2022-02-13T02:06:53.000Z | tests/test_pyliquibase.py | memiiso/pyliquibase | c9aa577a7f685888ae389416f8d41faa04a2152e | [
"Apache-2.0"
] | 4 | 2020-07-12T20:36:08.000Z | 2021-12-16T15:41:48.000Z | tests/test_pyliquibase.py | memiiso/pyliquibase | c9aa577a7f685888ae389416f8d41faa04a2152e | [
"Apache-2.0"
] | 6 | 2020-06-18T17:29:27.000Z | 2022-01-27T08:07:29.000Z | import os
import pathlib
from unittest import TestCase
from pyliquibase import Pyliquibase
class TestPyliquibase(TestCase):
def setUp(self):
self.dir_test = pathlib.Path(__file__).parent
self.testdb = self.dir_test.as_posix() + 'testdb'
self.testlogfile = self.dir_test.joinpath('liquibase... | 29.6875 | 118 | 0.64 | import os
import pathlib
from unittest import TestCase
from pyliquibase import Pyliquibase
class TestPyliquibase(TestCase):
def setUp(self):
self.dir_test = pathlib.Path(__file__).parent
self.testdb = self.dir_test.as_posix() + 'testdb'
self.testlogfile = self.dir_test.joinpath('liquibase... | true | true |
1c0db2bb0a7737735742d31130400fd67a8cb5b5 | 335 | py | Python | packer_builder/specs/provisioners/windows.py | mrlesmithjr/packer-builder | ff07b48740062c1a3050e670187bcd620a901b1c | [
"MIT"
] | 11 | 2019-10-16T21:05:58.000Z | 2021-08-03T16:14:51.000Z | packer_builder/specs/provisioners/windows.py | mrlesmithjr/packer-builder | ff07b48740062c1a3050e670187bcd620a901b1c | [
"MIT"
] | 35 | 2019-10-16T13:15:30.000Z | 2020-05-21T05:20:29.000Z | packer_builder/specs/provisioners/windows.py | mrlesmithjr/packer-builder | ff07b48740062c1a3050e670187bcd620a901b1c | [
"MIT"
] | 4 | 2020-03-02T15:45:26.000Z | 2021-08-24T17:58:36.000Z | """packer_builder/specs/provisioners/windows.py"""
def windows_provisioners(**kwargs):
"""Windows specific provisioners."""
# Setup vars from kwargs
# vagrant_box = kwargs['data']['vagrant_box']
# build_scripts_dir = kwargs['data']['build_scripts_dir']
template = kwargs['data']['template']
r... | 25.769231 | 61 | 0.689552 |
def windows_provisioners(**kwargs):
template = kwargs['data']['template']
return template
| true | true |
1c0db318b20ee9d2b048f0f9454c6f13cc3b55e0 | 23,423 | py | Python | kdis6502.py | Sultaneous/k6502 | 744ed22dc33d92a7799fff4a910d23a3f619d7b0 | [
"MIT"
] | null | null | null | kdis6502.py | Sultaneous/k6502 | 744ed22dc33d92a7799fff4a910d23a3f619d7b0 | [
"MIT"
] | null | null | null | kdis6502.py | Sultaneous/k6502 | 744ed22dc33d92a7799fff4a910d23a3f619d7b0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
'''
6502 Disassembler Utility
220126 KAS Created this script
220203 Finished first version (prototype)
Accepts a 6502 binary file as argument, and disassembles it to 6502 asm.
For C64 files, specify the location header as an option for proper parsing.
'''
### MODULES ###
from __future__ import anno... | 32.577191 | 146 | 0.609657 |
from __future__ import annotations
import json
import types
import datetime
import getopt
from gamzia.colours import Colours as C
from gamzia.timer import Timer
from gamzia.datastructures import Stack, Queue, BinaryTree, TRAVERSALS
import os
import sys
import io
argv=sys.argv
argc=len(argv)
INDENT=" "*5
APP_NAME ... | true | true |
1c0db4f3c487a6fa8794972ce314bf5558992ed1 | 4,461 | py | Python | tests/pipeindexer/test_pruningpipe.py | ogierpaul/suricate | fd43627e5d2a92fe4bf7b562f65ab89ec07ee49c | [
"MIT"
] | 1 | 2019-06-04T22:11:21.000Z | 2019-06-04T22:11:21.000Z | tests/pipeindexer/test_pruningpipe.py | ogierpaul/wookie | fd43627e5d2a92fe4bf7b562f65ab89ec07ee49c | [
"MIT"
] | 4 | 2020-03-31T03:52:32.000Z | 2020-04-20T20:17:13.000Z | tests/pipeindexer/test_pruningpipe.py | ogierpaul/wookie | fd43627e5d2a92fe4bf7b562f65ab89ec07ee49c | [
"MIT"
] | 1 | 2020-04-18T08:51:17.000Z | 2020-04-18T08:51:17.000Z | from suricate.pipeline.pruningpipe import PruningPipe
from suricate.data.companies import getXst, getytrue
from suricate.explore import Explorer, KBinsCluster
from suricate.dftransformers import DfConnector, VectorizerConnector, ExactConnector
from suricate.sbstransformers import SbsApplyComparator
from sklearn.pipelin... | 36.268293 | 94 | 0.668684 | from suricate.pipeline.pruningpipe import PruningPipe
from suricate.data.companies import getXst, getytrue
from suricate.explore import Explorer, KBinsCluster
from suricate.dftransformers import DfConnector, VectorizerConnector, ExactConnector
from suricate.sbstransformers import SbsApplyComparator
from sklearn.pipelin... | true | true |
1c0db57303a47696def9f2e676da3538a9860640 | 24,590 | py | Python | sympy/assumptions/handlers/sets.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/assumptions/handlers/sets.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | sympy/assumptions/handlers/sets.py | Michal-Gagala/sympy | 3cc756c2af73b5506102abaeefd1b654e286e2c8 | [
"MIT"
] | null | null | null | """
Handlers for predicates related to set membership: integer, rational, etc.
"""
from sympy.assumptions import Q, ask
from sympy.core import Add, Basic, Expr, Mul, Pow, S
from sympy.core.numbers import (AlgebraicNumber, ComplexInfinity, Exp1, Float,
GoldenRatio, ImaginaryUnit, Infinity, Integer, NaN, Nega... | 31.811125 | 93 | 0.612403 |
from sympy.assumptions import Q, ask
from sympy.core import Add, Basic, Expr, Mul, Pow, S
from sympy.core.numbers import (AlgebraicNumber, ComplexInfinity, Exp1, Float,
GoldenRatio, ImaginaryUnit, Infinity, Integer, NaN, NegativeInfinity,
Number, NumberSymbol, Pi, pi, Rational, TribonacciConstant, E)
fro... | true | true |
1c0db6a9275d63842491a6fcc44b67a36445e839 | 5,458 | py | Python | setup.py | ashao/SmartSim | 54ca7a72e4e19a167b67b8d16daf113e81f75817 | [
"BSD-2-Clause"
] | null | null | null | setup.py | ashao/SmartSim | 54ca7a72e4e19a167b67b8d16daf113e81f75817 | [
"BSD-2-Clause"
] | null | null | null | setup.py | ashao/SmartSim | 54ca7a72e4e19a167b67b8d16daf113e81f75817 | [
"BSD-2-Clause"
] | null | null | null | import os
import stat
import subprocess
import shutil
from pathlib import Path
import multiprocessing as mp
import cmake
from setuptools import setup
from setuptools.dist import Distribution
from setuptools.command.install import install
from setuptools.command.build_py import build_py
# get number of processors
NPRO... | 29.989011 | 96 | 0.613228 | import os
import stat
import subprocess
import shutil
from pathlib import Path
import multiprocessing as mp
import cmake
from setuptools import setup
from setuptools.dist import Distribution
from setuptools.command.install import install
from setuptools.command.build_py import build_py
NPROC = mp.cpu_count()
class Bu... | true | true |
1c0db75a11d6d417da5f3ee1bfd6fe70a824d479 | 2,618 | py | Python | fjord/journal/models.py | rlr/fjord | 04bb901773d5d9ef3059c2e30423a1a79a6ab622 | [
"BSD-3-Clause"
] | null | null | null | fjord/journal/models.py | rlr/fjord | 04bb901773d5d9ef3059c2e30423a1a79a6ab622 | [
"BSD-3-Clause"
] | null | null | null | fjord/journal/models.py | rlr/fjord | 04bb901773d5d9ef3059c2e30423a1a79a6ab622 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime, timedelta
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from fjord.base.models import JSONObjectField
RECORD_INFO = u'info'
RECORD_ERROR = u'error'
class RecordManager(models.Manager):
@cla... | 29.41573 | 77 | 0.63751 | from datetime import datetime, timedelta
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from fjord.base.models import JSONObjectField
RECORD_INFO = u'info'
RECORD_ERROR = u'error'
class RecordManager(models.Manager):
@cla... | true | true |
1c0db7b68288ad29b7bf7d05d03c5b96a9d23ca5 | 2,222 | py | Python | test/functional/rpc_estimatefee.py | ocvcoin/ocvcoin | e816ac4a7dc57b00a5e085052a6bb3c94bf4959b | [
"MIT"
] | 2 | 2021-10-30T04:29:45.000Z | 2021-12-11T16:49:57.000Z | test/functional/rpc_estimatefee.py | ocvcoin/ocvcoin | e816ac4a7dc57b00a5e085052a6bb3c94bf4959b | [
"MIT"
] | 2 | 2021-09-13T22:46:42.000Z | 2021-09-14T08:47:00.000Z | test/functional/rpc_estimatefee.py | ocvcoin/ocvcoin | e816ac4a7dc57b00a5e085052a6bb3c94bf4959b | [
"MIT"
] | 2 | 2021-11-18T09:48:59.000Z | 2021-12-23T04:33:02.000Z | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Ocvcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the estimatefee RPCs.
Test the following RPCs:
- estimatesmartfee
- estimaterawfee
"""
fro... | 41.924528 | 167 | 0.707021 |
from test_framework.test_framework import OcvcoinTestFramework
from test_framework.util import assert_raises_rpc_error
class EstimateFeeTest(OcvcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
def run_test(self):
assert_raises_rpc_error(-1, "estimatesmartfee", self.no... | true | true |
1c0db7e7b444a909478a6f60dda85bb9247d1672 | 10,355 | py | Python | backend/logs/get_server_logs.py | sleepingAnt/viewfinder | 9caf4e75faa8070d85f605c91d4cfb52c4674588 | [
"Apache-2.0"
] | 645 | 2015-01-03T02:03:59.000Z | 2021-12-03T08:43:16.000Z | backend/logs/get_server_logs.py | hoowang/viewfinder | 9caf4e75faa8070d85f605c91d4cfb52c4674588 | [
"Apache-2.0"
] | null | null | null | backend/logs/get_server_logs.py | hoowang/viewfinder | 9caf4e75faa8070d85f605c91d4cfb52c4674588 | [
"Apache-2.0"
] | 222 | 2015-01-07T05:00:52.000Z | 2021-12-06T09:54:26.000Z | # Copyright 2012 Viewfinder Inc. All Rights Reserved.
"""Merge server logs from S3 into daily directories, with one file per instance.
Does the following:
1) fetch list of log files from S3://serverlog-viewfinder-co/viewfinder/full/
fetch list of processed files from file S3://serverlog-viewfinder-co/processed_log... | 41.25498 | 116 | 0.72902 |
__author__ = 'marc@emailscrubbed.com (Marc Berhault)'
import cStringIO
import logging
import os
import re
import sys
from tornado import gen, options
from viewfinder.backend.base import main, retry
from viewfinder.backend.db import db_client
from viewfinder.backend.db.job import Job
from viewfinder.backend.logs imp... | true | true |
1c0db84e98d1086c5565058bd08181e355ba2d0a | 2,412 | py | Python | livesync_debug/indico_livesync_debug/backend.py | aloysiuszeno/indico-plugins | 9b489292425284e717fd67b73d65c08da825f07c | [
"MIT"
] | null | null | null | livesync_debug/indico_livesync_debug/backend.py | aloysiuszeno/indico-plugins | 9b489292425284e717fd67b73d65c08da825f07c | [
"MIT"
] | null | null | null | livesync_debug/indico_livesync_debug/backend.py | aloysiuszeno/indico-plugins | 9b489292425284e717fd67b73d65c08da825f07c | [
"MIT"
] | null | null | null | # This file is part of the Indico plugins.
# Copyright (C) 2002 - 2019 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from __future__ import unicode_literals
from indico.util.console import cfor... | 33.5 | 114 | 0.662935 |
from __future__ import unicode_literals
from indico.util.console import cformat
from indico.util.struct.iterables import grouper
from indico_livesync import LiveSyncBackendBase, MARCXMLGenerator, SimpleChange, Uploader, process_records
def _change_str(change):
return ','.join(flag.name for flag in SimpleChange... | false | true |
1c0db904b97a5d2a9161cb5c0c8ea8cb0897c331 | 25,800 | py | Python | src/lib/Bcfg2/Client/Tools/SELinux.py | stpierre/bcfg2 | 363ad4fd2b36febbbe6b766dac9e76c572048e08 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Client/Tools/SELinux.py | stpierre/bcfg2 | 363ad4fd2b36febbbe6b766dac9e76c572048e08 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Client/Tools/SELinux.py | stpierre/bcfg2 | 363ad4fd2b36febbbe6b766dac9e76c572048e08 | [
"mpich2"
] | null | null | null | import os
import re
import sys
import copy
import glob
import struct
import socket
import selinux
import seobject
import Bcfg2.Client.XML
import Bcfg2.Client.Tools
import Bcfg2.Client.Tools.POSIX
def pack128(int_val):
""" pack a 128-bit integer in big-endian format """
max_int = 2 ** (128) - 1
max_word_siz... | 35.983264 | 90 | 0.535853 | import os
import re
import sys
import copy
import glob
import struct
import socket
import selinux
import seobject
import Bcfg2.Client.XML
import Bcfg2.Client.Tools
import Bcfg2.Client.Tools.POSIX
def pack128(int_val):
""" pack a 128-bit integer in big-endian format """
max_int = 2 ** (128) - 1
max_word_siz... | false | true |
1c0dba93d0ce7ff76eeb756338ab7a8edb429bf1 | 4,160 | py | Python | examples/trader/vol_macd_trader.py | zhnagchulan/zvt | f03bfebc915dc358180c4ad977455ac7771237e3 | [
"MIT"
] | null | null | null | examples/trader/vol_macd_trader.py | zhnagchulan/zvt | f03bfebc915dc358180c4ad977455ac7771237e3 | [
"MIT"
] | null | null | null | examples/trader/vol_macd_trader.py | zhnagchulan/zvt | f03bfebc915dc358180c4ad977455ac7771237e3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from typing import List, Union
import pandas as pd
from zvt.contract import IntervalLevel, EntityMixin
from zvt.domain import Stock1dKdata, Stock
from zvt.factors import TargetSelector, BullFactor, ScoreFactor, Transformer, Accumulator
from zvt.factors.algorithm import RankScorer
from zvt.trad... | 62.089552 | 119 | 0.667788 | from typing import List, Union
import pandas as pd
from zvt.contract import IntervalLevel, EntityMixin
from zvt.domain import Stock1dKdata, Stock
from zvt.factors import TargetSelector, BullFactor, ScoreFactor, Transformer, Accumulator
from zvt.factors.algorithm import RankScorer
from zvt.trader.trader import StockTr... | true | true |
1c0dbacd633c4cd2c7d9b99c25906f3c16b6a0a9 | 4,529 | py | Python | pipeline_plugins/tests/cmdb_ip_picker/utils/test_get_modules_of_bk_obj.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | 881 | 2019-03-25T02:45:42.000Z | 2022-03-30T09:10:49.000Z | pipeline_plugins/tests/cmdb_ip_picker/utils/test_get_modules_of_bk_obj.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | 3,303 | 2019-03-25T04:18:03.000Z | 2022-03-31T11:52:03.000Z | pipeline_plugins/tests/cmdb_ip_picker/utils/test_get_modules_of_bk_obj.py | wkma/bk-sops | 8fb5609c0c4495c28d588fbafa9d9f5f2976929b | [
"Apache-2.0"
] | 395 | 2019-03-25T02:53:36.000Z | 2022-03-31T08:37:28.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 39.043103 | 115 | 0.386399 |
from django.test import TestCase
from pipeline_plugins.cmdb_ip_picker.utils import get_modules_of_bk_obj
class GetModulesOfBkObjTestCase(TestCase):
def setUp(self):
self.topo_tree = {
"default": 0,
"bk_obj_name": "业务",
"bk_obj_id": "biz",
"child": [
... | true | true |
1c0dbb70f92a0a5045d4b4ccae539c3d33b67a28 | 1,893 | py | Python | saleor/graphql/product/types/digital_contents.py | sebasgoldberg/saleor | 2e94e8df80f305889434f549a4da6abc1257b598 | [
"CC-BY-4.0"
] | 4 | 2021-04-09T01:07:00.000Z | 2022-02-15T10:51:39.000Z | saleor/graphql/product/types/digital_contents.py | sebasgoldberg/saleor | 2e94e8df80f305889434f549a4da6abc1257b598 | [
"CC-BY-4.0"
] | 14 | 2021-02-02T23:28:13.000Z | 2022-03-12T01:00:31.000Z | saleor/graphql/product/types/digital_contents.py | sebasgoldberg/saleor | 2e94e8df80f305889434f549a4da6abc1257b598 | [
"CC-BY-4.0"
] | 4 | 2020-05-08T07:17:03.000Z | 2020-05-16T12:34:57.000Z | import graphene
import graphene_django_optimizer as gql_optimizer
from graphene import relay
from ....core.permissions import ProductPermissions
from ....product import models
from ...core.connection import CountableDjangoObjectType
from ...decorators import permission_required
from ...meta.deprecated.resolvers import... | 31.032787 | 76 | 0.684628 | import graphene
import graphene_django_optimizer as gql_optimizer
from graphene import relay
from ....core.permissions import ProductPermissions
from ....product import models
from ...core.connection import CountableDjangoObjectType
from ...decorators import permission_required
from ...meta.deprecated.resolvers import... | true | true |
1c0dbc186607de3b3dc959e229d7307f0f3c16ad | 5,601 | py | Python | example_configs/speech2text/w2lplus_large_8gpus_mp.py | acidcoma/OpenSeq2Seq | a44eee8929df6535fc6e5a164b6b19b2f7b5d462 | [
"Apache-2.0"
] | null | null | null | example_configs/speech2text/w2lplus_large_8gpus_mp.py | acidcoma/OpenSeq2Seq | a44eee8929df6535fc6e5a164b6b19b2f7b5d462 | [
"Apache-2.0"
] | null | null | null | example_configs/speech2text/w2lplus_large_8gpus_mp.py | acidcoma/OpenSeq2Seq | a44eee8929df6535fc6e5a164b6b19b2f7b5d462 | [
"Apache-2.0"
] | null | null | null | # pylint: skip-file
import tensorflow as tf
from open_seq2seq.models import Speech2Text
from open_seq2seq.encoders import TDNNEncoder
from open_seq2seq.decoders import FullyConnectedCTCDecoder
from open_seq2seq.data import Speech2TextDataLayer
from open_seq2seq.losses import CTCLoss
from open_seq2seq.optimizers.lr_poli... | 31.644068 | 94 | 0.54276 | import tensorflow as tf
from open_seq2seq.models import Speech2Text
from open_seq2seq.encoders import TDNNEncoder
from open_seq2seq.decoders import FullyConnectedCTCDecoder
from open_seq2seq.data import Speech2TextDataLayer
from open_seq2seq.losses import CTCLoss
from open_seq2seq.optimizers.lr_policies import poly_dec... | true | true |
1c0dbcf4ed28b9f025d78937302102ec15327eed | 9,583 | py | Python | lifegame.py | Delay-n-days/lifegame_six | 5fbec60a2913f439daa7b393f89cf7c7656dbf6f | [
"Apache-2.0"
] | null | null | null | lifegame.py | Delay-n-days/lifegame_six | 5fbec60a2913f439daa7b393f89cf7c7656dbf6f | [
"Apache-2.0"
] | null | null | null | lifegame.py | Delay-n-days/lifegame_six | 5fbec60a2913f439daa7b393f89cf7c7656dbf6f | [
"Apache-2.0"
] | null | null | null | #!/usr/binenv python
# -*- coding: utf-8 -*-
#文档地址 http://los-cocos.github.io/cocos-site/doc/programming_guide/index.html
from __future__ import print_function, division
import random
from cocos.director import director
from cocos.scene import Scene
from cocos.scenes import *
from cocos.layer import ColorLayer
from c... | 35.757463 | 152 | 0.552958 | from __future__ import print_function, division
import random
from cocos.director import director
from cocos.scene import Scene
from cocos.scenes import *
from cocos.layer import ColorLayer
from cocos.sprite import Sprite
from cocos.text import Label
from cocos.actions import *
import cocos.euclid as eu
import cocos.... | true | true |
1c0dbe3fdb574cddb8a444e9b889f4500d7d9c1d | 4,788 | py | Python | videojuegos/arcanoid/game.py | joseluisGA/videojuegos | a8795447fd40cd8fe032cadb4f2a1bd309a6e0de | [
"MIT"
] | null | null | null | videojuegos/arcanoid/game.py | joseluisGA/videojuegos | a8795447fd40cd8fe032cadb4f2a1bd309a6e0de | [
"MIT"
] | null | null | null | videojuegos/arcanoid/game.py | joseluisGA/videojuegos | a8795447fd40cd8fe032cadb4f2a1bd309a6e0de | [
"MIT"
] | null | null | null | import pygame
from settings import *
from pygame import Vector2
import math
from ball import Ball
from pad import Pad
from brick import Brick
import random
from os import path
# El jugador controla una PALA que mueve en horizontal, con incercia
# Debe evitar que la/s BOLAS caigan por la parte inferior de la pantalla
... | 35.466667 | 129 | 0.629073 | import pygame
from settings import *
from pygame import Vector2
import math
from ball import Ball
from pad import Pad
from brick import Brick
import random
from os import path
class Game:
def __init__(self):
pygame.mixer.pre_init(44100, -16, 2, 1024)
pygame.init()
pygame.mixer.init()
... | true | true |
1c0dbe616d643e59803710bce78eb0406fcbff5d | 54,941 | py | Python | lib/galaxy/workflow/modules.py | igorhollaender/sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | 2 | 2018-10-14T16:42:39.000Z | 2018-10-14T16:42:41.000Z | lib/galaxy/workflow/modules.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/workflow/modules.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | null | null | null | """
Modules used in building workflows
"""
import logging
from json import dumps, loads
from xml.etree.ElementTree import Element
from galaxy import exceptions, model, web
from galaxy.dataset_collections import matching
from galaxy.jobs.actions.post import ActionBox
from galaxy.model import PostJobAction
from galaxy.t... | 40.970172 | 243 | 0.629948 | """
Modules used in building workflows
"""
import logging
from json import dumps, loads
from xml.etree.ElementTree import Element
from galaxy import exceptions, model, web
from galaxy.dataset_collections import matching
from galaxy.jobs.actions.post import ActionBox
from galaxy.model import PostJobAction
from galaxy.t... | false | true |
1c0dbf050e363e90123bf527d6132a415b2e9c0e | 2,826 | py | Python | gtts/utils.py | paperbenni/gTTS | 30e4f3d9e79db44462c47f1bd249b206d08828a2 | [
"MIT"
] | null | null | null | gtts/utils.py | paperbenni/gTTS | 30e4f3d9e79db44462c47f1bd249b206d08828a2 | [
"MIT"
] | null | null | null | gtts/utils.py | paperbenni/gTTS | 30e4f3d9e79db44462c47f1bd249b206d08828a2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from gtts.tokenizer.symbols import ALL_PUNC as punc
from string import whitespace as ws
import re
_ALL_PUNC_OR_SPACE = re.compile(u"^[{}]*$".format(re.escape(punc + ws)))
"""Regex that matches if an entire line is only comprised
of whitespace and punctuation
"""
def _minimize(the_string, del... | 32.482759 | 79 | 0.642958 | from gtts.tokenizer.symbols import ALL_PUNC as punc
from string import whitespace as ws
import re
_ALL_PUNC_OR_SPACE = re.compile(u"^[{}]*$".format(re.escape(punc + ws)))
def _minimize(the_string, delim, max_size):
if the_string.startswith(delim):
the_string = the_string[_len(delim):]
if... | true | true |
1c0dbf528035569aeaf3876766f00fb0e8e0ab5d | 969 | py | Python | threads/cpu_attempt/compute_threaded.py | vromanuk/async_techniques | 7e1c6efcd4c81c322002eb3002d5bb929c5bc623 | [
"MIT"
] | null | null | null | threads/cpu_attempt/compute_threaded.py | vromanuk/async_techniques | 7e1c6efcd4c81c322002eb3002d5bb929c5bc623 | [
"MIT"
] | null | null | null | threads/cpu_attempt/compute_threaded.py | vromanuk/async_techniques | 7e1c6efcd4c81c322002eb3002d5bb929c5bc623 | [
"MIT"
] | null | null | null | import math
import datetime
import threading
import multiprocessing
def main():
do_math(1)
t0 = datetime.datetime.now()
# do_math(num=30000000)
processor_count = multiprocessing.cpu_count()
print('Doing math on {:,} processors.'.format(multiprocessing.cpu_count()))
threads = []
for n in r... | 24.846154 | 91 | 0.566563 | import math
import datetime
import threading
import multiprocessing
def main():
do_math(1)
t0 = datetime.datetime.now()
processor_count = multiprocessing.cpu_count()
print('Doing math on {:,} processors.'.format(multiprocessing.cpu_count()))
threads = []
for n in range(1, processor_count ... | true | true |
1c0dc06f4af7421d264a629f0a2f4ecf37435b53 | 2,279 | py | Python | pytext/models/representations/pure_doc_attention.py | Titousensei/pytext-1 | 6ea5ce52f5070fc10ac20732f994296c4d445207 | [
"BSD-3-Clause"
] | 3 | 2019-10-19T11:16:12.000Z | 2021-11-17T11:09:00.000Z | pytext/models/representations/pure_doc_attention.py | Titousensei/pytext-1 | 6ea5ce52f5070fc10ac20732f994296c4d445207 | [
"BSD-3-Clause"
] | null | null | null | pytext/models/representations/pure_doc_attention.py | Titousensei/pytext-1 | 6ea5ce52f5070fc10ac20732f994296c4d445207 | [
"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
from typing import Any, Optional, Union
import torch
import torch.nn as nn
from pytext.config import ConfigBase
from pytext.models.decoders.mlp_decoder import MLPDecoder
from pytext.models.module import create_module
from .p... | 31.219178 | 84 | 0.642826 | from typing import Any, Optional, Union
import torch
import torch.nn as nn
from pytext.config import ConfigBase
from pytext.models.decoders.mlp_decoder import MLPDecoder
from pytext.models.module import create_module
from .pooling import BoundaryPool, MaxPool, MeanPool, NoPool, SelfAttention
from .representation_base... | true | true |
1c0dc0cb42c5927ee8e13e9b09138d2545340f73 | 414 | py | Python | Ekeopara_Praise/Phase 2/STRINGS/Day33 Tasks/Task2.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | Ekeopara_Praise/Phase 2/STRINGS/Day33 Tasks/Task2.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | Ekeopara_Praise/Phase 2/STRINGS/Day33 Tasks/Task2.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z | '''2. Write a Python program to count repeated characters in a string.
Sample string: 'thequickbrownfoxjumpsoverthelazydog'
Expected output :
o 4
e 3
u 2
h 2
r 2
t 2'''
import collections
str1 = 'thequickbrownfoxjumpsoverthelazydog'
d = collections.defaultdict(int)
for c in str1:
d[c] += 1
for c in sorted(d, key... | 19.714286 | 71 | 0.693237 |
import collections
str1 = 'thequickbrownfoxjumpsoverthelazydog'
d = collections.defaultdict(int)
for c in str1:
d[c] += 1
for c in sorted(d, key=d.get, reverse=True):
if d[c] > 1:
print('%s %d' % (c, d[c]))
| true | true |
1c0dc0fda29bc43828323fb1e12c80f721110e67 | 159 | py | Python | python/268C.py | shohrukh92/codeforces | cca751d36b87a42cc4ef4da566198db4eb3e0ddc | [
"MIT"
] | null | null | null | python/268C.py | shohrukh92/codeforces | cca751d36b87a42cc4ef4da566198db4eb3e0ddc | [
"MIT"
] | null | null | null | python/268C.py | shohrukh92/codeforces | cca751d36b87a42cc4ef4da566198db4eb3e0ddc | [
"MIT"
] | null | null | null | # http://codeforces.com/contest/268/problem/C
n, m = map(int, input().split())
d = min(n, m)
print(d + 1)
for i in range(d + 1): print("{} {}".format(d-i, i)) | 26.5 | 52 | 0.584906 |
n, m = map(int, input().split())
d = min(n, m)
print(d + 1)
for i in range(d + 1): print("{} {}".format(d-i, i)) | true | true |
1c0dc1698c47078b1266e7d3568d167e0c8e477e | 95 | py | Python | services/dispatcher/data/__init__.py | jizt-it/jizt-backend-microservice | 0aeb55e519007104fa19e0469938193a9383a08b | [
"Apache-2.0"
] | 2 | 2021-02-25T07:41:53.000Z | 2021-07-01T10:11:37.000Z | services/dispatcher/data/__init__.py | jizt-it/jizt-backend-microservice | 0aeb55e519007104fa19e0469938193a9383a08b | [
"Apache-2.0"
] | 11 | 2021-03-18T12:10:55.000Z | 2022-02-16T12:47:20.000Z | services/dispatcher/data/__init__.py | jizt-it/jizt-backend-microservice | 0aeb55e519007104fa19e0469938193a9383a08b | [
"Apache-2.0"
] | null | null | null | import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent)) # data dir
| 23.75 | 58 | 0.757895 | import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent)) | true | true |
1c0dc1c2936bc8ab2842ee9ac245aa0b2b9a6b39 | 9,663 | py | Python | bips/workflows/scripts/ua780b1988e1c11e1baf80019b9f22493/base.py | FCP-INDI/BrainImagingPipelines | 2b0da2b50814cc685f15fefbae8144624308ebfc | [
"Apache-2.0"
] | 1 | 2015-07-15T19:48:09.000Z | 2015-07-15T19:48:09.000Z | bips/workflows/scripts/ua780b1988e1c11e1baf80019b9f22493/base.py | FCP-INDI/BrainImagingPipelines | 2b0da2b50814cc685f15fefbae8144624308ebfc | [
"Apache-2.0"
] | null | null | null | bips/workflows/scripts/ua780b1988e1c11e1baf80019b9f22493/base.py | FCP-INDI/BrainImagingPipelines | 2b0da2b50814cc685f15fefbae8144624308ebfc | [
"Apache-2.0"
] | null | null | null | from bips.workflows.scripts.ua780b1988e1c11e1baf80019b9f22493.utils import (convert_affine, get_image_dimensions)
def get_struct_norm_workflow(name='normalize_struct'):
""" Base structural workflow for normalization
Parameters
----------
name : name of workflow. Default = 'normalize_struct'
Inpu... | 37.165385 | 113 | 0.613267 | from bips.workflows.scripts.ua780b1988e1c11e1baf80019b9f22493.utils import (convert_affine, get_image_dimensions)
def get_struct_norm_workflow(name='normalize_struct'):
import nipype.interfaces.freesurfer as fs
import nipype.interfaces.ants as ants
import nipype.pipeline.engine as pe
import nipype... | true | true |
1c0dc21b942ecbf48d58f83330ace6156f3d6cbb | 40,566 | py | Python | tests/test_qubit_device.py | doomhammerhell/pennylane | f147f22d8d99ba5891edd45a6a1f7dd679c8a23c | [
"Apache-2.0"
] | 712 | 2020-07-29T03:46:52.000Z | 2022-03-27T11:21:51.000Z | tests/test_qubit_device.py | doomhammerhell/pennylane | f147f22d8d99ba5891edd45a6a1f7dd679c8a23c | [
"Apache-2.0"
] | 1,627 | 2020-07-28T13:07:58.000Z | 2022-03-31T21:47:29.000Z | tests/test_qubit_device.py | doomhammerhell/pennylane | f147f22d8d99ba5891edd45a6a1f7dd679c8a23c | [
"Apache-2.0"
] | 249 | 2020-07-29T03:26:18.000Z | 2022-03-31T19:59:48.000Z | # Copyright 2018-2020 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 37.841418 | 122 | 0.616995 |
import pytest
import numpy as np
from random import random
import pennylane as qml
from pennylane import QubitDevice, DeviceError, QuantumFunctionError
from pennylane.operation import Sample, Variance, Expectation, Probability, State
from pennylane.circuit_graph import CircuitGraph
from pennylane.wires import Wires... | true | true |
1c0dc24be986d721d610eb0906e820e2e86ab055 | 1,285 | py | Python | tests/test_role_querying.py | gravitational/rbac-linter | 57c21b4258831395f5543edb1a3ccfdcf0177d9b | [
"Apache-2.0"
] | 24 | 2021-12-05T17:59:10.000Z | 2022-03-22T20:09:31.000Z | tests/test_role_querying.py | gravitational/rbac-linter | 57c21b4258831395f5543edb1a3ccfdcf0177d9b | [
"Apache-2.0"
] | 5 | 2021-12-09T13:54:53.000Z | 2022-02-17T20:43:39.000Z | tests/test_role_querying.py | gravitational/rbac-linter | 57c21b4258831395f5543edb1a3ccfdcf0177d9b | [
"Apache-2.0"
] | 4 | 2021-12-14T15:26:10.000Z | 2022-01-20T10:35:08.000Z | import os
import pytest
from role_analyzer import role_allows_user_access_to_entity, UserType, EntityType
import yaml
from z3 import Solver # type: ignore
@pytest.fixture
def change_test_dir(request):
os.chdir(request.fspath.dirname)
yield
os.chdir(request.config.invocation_dir)
def test_role_querying(... | 32.948718 | 81 | 0.595331 | import os
import pytest
from role_analyzer import role_allows_user_access_to_entity, UserType, EntityType
import yaml
from z3 import Solver
@pytest.fixture
def change_test_dir(request):
os.chdir(request.fspath.dirname)
yield
os.chdir(request.config.invocation_dir)
def test_role_querying(change_test_dir... | true | true |
1c0dc28b8f92ef4540e6221bd6af641bbda91762 | 147 | py | Python | HLTrigger/Configuration/python/HLT_75e33/tasks/highlevelrecoTask_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | HLTrigger/Configuration/python/HLT_75e33/tasks/highlevelrecoTask_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | HLTrigger/Configuration/python/HLT_75e33/tasks/highlevelrecoTask_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:16:05.000Z | 2021-11-30T16:16:05.000Z | import FWCore.ParameterSet.Config as cms
from ..tasks.particleFlowRecoTask_cfi import *
highlevelrecoTask = cms.Task(
particleFlowRecoTask
)
| 18.375 | 46 | 0.802721 | import FWCore.ParameterSet.Config as cms
from ..tasks.particleFlowRecoTask_cfi import *
highlevelrecoTask = cms.Task(
particleFlowRecoTask
)
| true | true |
1c0dc3471cc3ab10a52c5bf74998f7fb7a77668c | 5,886 | py | Python | HostUnityProj/Assets/Testing/testserver/HelloRpc_pb2.py | boostmerlin/UnityPolymer | 07ac3a3734609b837ca37cb2986ca3ea14da33c0 | [
"MIT"
] | 1 | 2018-03-22T05:45:02.000Z | 2018-03-22T05:45:02.000Z | HostUnityProj/Assets/Testing/testserver/HelloRpc_pb2.py | moonlight1986/UnityPolymer | 07ac3a3734609b837ca37cb2986ca3ea14da33c0 | [
"MIT"
] | null | null | null | HostUnityProj/Assets/Testing/testserver/HelloRpc_pb2.py | moonlight1986/UnityPolymer | 07ac3a3734609b837ca37cb2986ca3ea14da33c0 | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: HelloRpc.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refl... | 30.340206 | 602 | 0.7421 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.p... | true | true |
1c0dc4b5d98e2eb5039d0f770d59e313770105d8 | 3,693 | py | Python | code/generation-model/progressive_transformer/encoders.py | Merterm/-Modeling-Intensification-for-SLG | 800fff3d3c7bacc86c1db8382f7c2e68d2f0c074 | [
"MIT"
] | 5 | 2022-03-14T15:52:09.000Z | 2022-03-30T11:42:47.000Z | code/generation-model/progressive_transformer/encoders.py | Merterm/Modeling-Intensification-for-SLG | 800fff3d3c7bacc86c1db8382f7c2e68d2f0c074 | [
"MIT"
] | null | null | null | code/generation-model/progressive_transformer/encoders.py | Merterm/Modeling-Intensification-for-SLG | 800fff3d3c7bacc86c1db8382f7c2e68d2f0c074 | [
"MIT"
] | null | null | null | # coding: utf-8
import torch
import torch.nn as nn
from torch import Tensor
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import torch.nn.functional as F
from helpers import freeze_params
from transformer_layers import \
TransformerEncoderLayer, PositionalEncoding
from embeddings impor... | 32.681416 | 75 | 0.607636 |
import torch
import torch.nn as nn
from torch import Tensor
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import torch.nn.functional as F
from helpers import freeze_params
from transformer_layers import \
TransformerEncoderLayer, PositionalEncoding
from embeddings import MaskedNorm
cl... | true | true |
1c0dc52b5e400f61b89326a97c6f9628924e92b9 | 1,207 | py | Python | 56.MergeIntervals2.py | ColinTing/Algorithm | 02c8087503298f050deb0fbee6cb887b3aeb6592 | [
"MIT"
] | null | null | null | 56.MergeIntervals2.py | ColinTing/Algorithm | 02c8087503298f050deb0fbee6cb887b3aeb6592 | [
"MIT"
] | null | null | null | 56.MergeIntervals2.py | ColinTing/Algorithm | 02c8087503298f050deb0fbee6cb887b3aeb6592 | [
"MIT"
] | null | null | null | # Definition for an interval.
class Interval:
def __init__(self, s=0, e=0):
self.start = s
self.end = e
class Solution:
def merge(self, intervals):
"""
:type intervals: List[Interval]
:rtype: List[Interval]
"""
if intervals is None or len(interval... | 27.431818 | 70 | 0.59652 | class Interval:
def __init__(self, s=0, e=0):
self.start = s
self.end = e
class Solution:
def merge(self, intervals):
if intervals is None or len(intervals)<=1:
return intervals
intervals.sort(key=lambda x:x.start)
start = intervals[0].start ... | true | true |
1c0dc575e75df04baddbe6adc98596a599402010 | 3,322 | py | Python | zest/base.py | Jezza672/zest | 5beaa3ab0661d1bd528154fd5d63f1d422ad49d1 | [
"MIT"
] | null | null | null | zest/base.py | Jezza672/zest | 5beaa3ab0661d1bd528154fd5d63f1d422ad49d1 | [
"MIT"
] | null | null | null | zest/base.py | Jezza672/zest | 5beaa3ab0661d1bd528154fd5d63f1d422ad49d1 | [
"MIT"
] | null | null | null | from time import time
from typing import Callable
from .result import Result, Results
all_tests = None
class Test_Base:
"""Virtual class that defines the pre-requisites that a test must fulfil"""
def __init__(self, test_list = all_tests):
test_list.register(self)
def __test__(self, *args, **kwar... | 29.140351 | 79 | 0.596328 | from time import time
from typing import Callable
from .result import Result, Results
all_tests = None
class Test_Base:
def __init__(self, test_list = all_tests):
test_list.register(self)
def __test__(self, *args, **kwargs) -> Result:
try:
t_start = time()
self._test(... | true | true |
1c0dc5b44916ff82c03e4e5782a025e3ea533b65 | 115,719 | py | Python | Lib/test/test_os.py | Taywee/isolated-python | cb6aab1248c4aec4dd578bea717854505a6fb55d | [
"PSF-2.0"
] | null | null | null | Lib/test/test_os.py | Taywee/isolated-python | cb6aab1248c4aec4dd578bea717854505a6fb55d | [
"PSF-2.0"
] | null | null | null | Lib/test/test_os.py | Taywee/isolated-python | cb6aab1248c4aec4dd578bea717854505a6fb55d | [
"PSF-2.0"
] | null | null | null | # As a test suite for the os module, this is woefully inadequate, but this
# does add tests for a few functions which have been determined to be more
# portable than they had been thought to be.
import asynchat
import asyncore
import codecs
import contextlib
import decimal
import errno
import fractions
import getpass
... | 37.340755 | 101 | 0.591917 |
import asynchat
import asyncore
import codecs
import contextlib
import decimal
import errno
import fractions
import getpass
import itertools
import locale
import mmap
import os
import pickle
import platform
import re
import shutil
import signal
import socket
import stat
import subprocess
import sys
import sysconfig
im... | true | true |
1c0dc62b9d8870360f2fd5391fcab6e69a110d73 | 20,190 | py | Python | mapel/roommates/objects/RoommatesExperiment.py | kaszperro/mapel | d4e6486ee97f5d5a5a737c581ba3f9f874ebcef3 | [
"MIT"
] | null | null | null | mapel/roommates/objects/RoommatesExperiment.py | kaszperro/mapel | d4e6486ee97f5d5a5a737c581ba3f9f874ebcef3 | [
"MIT"
] | null | null | null | mapel/roommates/objects/RoommatesExperiment.py | kaszperro/mapel | d4e6486ee97f5d5a5a737c581ba3f9f874ebcef3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import ast
import copy
import csv
import itertools
import os
from threading import Thread
from multiprocessing import Process, Queue
from time import sleep
import time
from mapel.main.objects.Experiment import Experiment
from mapel.roommates.objects.RoommatesFamily import RoommatesFamily
from map... | 40.38 | 115 | 0.528529 | import ast
import copy
import csv
import itertools
import os
from threading import Thread
from multiprocessing import Process, Queue
from time import sleep
import time
from mapel.main.objects.Experiment import Experiment
from mapel.roommates.objects.RoommatesFamily import RoommatesFamily
from mapel.roommates.objects.R... | true | true |
1c0dc6ff417e31636433e446bffb3f9f71eed201 | 6,240 | py | Python | MyLighthouse/lighthouse/ui/functrace_overview.py | cbwang505/DIYDynamoRIO | dc7e16020d45fc3e9faa493a3b0da74722e8333f | [
"MulanPSL-1.0"
] | 14 | 2020-12-22T03:15:38.000Z | 2022-01-30T09:22:06.000Z | MyLighthouse/lighthouse/ui/functrace_overview.py | cbwang505/DIYDynamoRIO | dc7e16020d45fc3e9faa493a3b0da74722e8333f | [
"MulanPSL-1.0"
] | 1 | 2021-06-01T12:10:25.000Z | 2021-06-01T12:10:25.000Z | MyLighthouse/lighthouse/ui/functrace_overview.py | cbwang505/DIYDynamoRIO | dc7e16020d45fc3e9faa493a3b0da74722e8333f | [
"MulanPSL-1.0"
] | 7 | 2021-01-01T03:03:57.000Z | 2022-03-29T07:28:38.000Z | import os
import logging
import weakref
from lighthouse.ui.functrace_table import FunctionTraceTableModel, FunctionTraceTableController, FunctionTraceTableView
from lighthouse.util.qt import *
from lighthouse.util.misc import plugin_resource
from lighthouse.util.disassembler import disassembler, DockableWindow
from li... | 31.675127 | 119 | 0.53109 | import os
import logging
import weakref
from lighthouse.ui.functrace_table import FunctionTraceTableModel, FunctionTraceTableController, FunctionTraceTableView
from lighthouse.util.qt import *
from lighthouse.util.misc import plugin_resource
from lighthouse.util.disassembler import disassembler, DockableWindow
from li... | true | true |
1c0dc71a10befbdc914c8026caffc0cfe4af799c | 188 | py | Python | mythril/version.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | null | null | null | mythril/version.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | null | null | null | mythril/version.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | null | null | null | """This file contains the current Mythril version.
This file is suitable for sourcing inside POSIX shell, e.g. bash as well
as for importing into Python.
"""
VERSION = "v0.20.4" # NOQA
| 23.5 | 72 | 0.728723 |
VERSION = "v0.20.4" | true | true |
1c0dc81cfa6e47cd324451c868f30d9a66184930 | 1,432 | py | Python | Python/RobotReturnToOrigin.py | ani03sha/potd | 05ca25039c5462b68dae9d83e856dd4c66e7ab63 | [
"MIT"
] | null | null | null | Python/RobotReturnToOrigin.py | ani03sha/potd | 05ca25039c5462b68dae9d83e856dd4c66e7ab63 | [
"MIT"
] | null | null | null | Python/RobotReturnToOrigin.py | ani03sha/potd | 05ca25039c5462b68dae9d83e856dd4c66e7ab63 | [
"MIT"
] | null | null | null | """
There is a robot starting at position (0, 0), the origin, on a 2D plane. Given a sequence of its moves,
judge if this robot ends up at (0, 0) after it completes its moves.
The move sequence is represented by a string, and the character moves[i] represents its ith move.
Valid moves are R (right), L (left), U (up)... | 31.822222 | 104 | 0.574721 | class RobotReturnToOrigin:
def judgeCircle(self, moves: str) -> bool:
if moves == None or len(moves) == 0:
return True
x = 0
y = 0
for c in moves:
if c == 'L':
x -= 1
elif c == 'R':
x += 1
... | true | true |
1c0dc945db5cca444d9590e382b9de1ce475f14d | 13,924 | py | Python | session_server/services/world_pb2.py | w359405949/browserquest_py | 20c2569431db9dca74a986efa9bc0ce69ed5a8fc | [
"WTFPL"
] | 1 | 2019-03-27T07:46:15.000Z | 2019-03-27T07:46:15.000Z | session_server/services/world_pb2.py | w359405949/browserquest_py | 20c2569431db9dca74a986efa9bc0ce69ed5a8fc | [
"WTFPL"
] | null | null | null | session_server/services/world_pb2.py | w359405949/browserquest_py | 20c2569431db9dca74a986efa9bc0ce69ed5a8fc | [
"WTFPL"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
DESCRIPTOR = descriptor.FileDescriptor(
name='world.proto',
... | 39.11236 | 1,267 | 0.708058 |
from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
DESCRIPTOR = descriptor.FileDescriptor(
name='world.proto',
package='',
serialized_pb='\n\x0bworld.proto\"\xa3\x01\n\tChestArea\x12\n\n\x02id\x18\x01 \x0... | true | true |
1c0dcad0711329c754f2354963bf65581b9abb97 | 15,645 | py | Python | pyscf/scf/test/test_uhf.py | LeonOtis/pyscf | 98ba8106396ac4c90dc65207059773ce048b0ebf | [
"Apache-2.0"
] | 2 | 2021-08-03T12:32:25.000Z | 2021-09-29T08:19:02.000Z | pyscf/scf/test/test_uhf.py | LeonOtis/pyscf | 98ba8106396ac4c90dc65207059773ce048b0ebf | [
"Apache-2.0"
] | null | null | null | pyscf/scf/test/test_uhf.py | LeonOtis/pyscf | 98ba8106396ac4c90dc65207059773ce048b0ebf | [
"Apache-2.0"
] | 2 | 2020-06-01T05:31:38.000Z | 2022-02-08T02:38:33.000Z | #!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. 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
#
# U... | 38.62963 | 111 | 0.575455 |
import copy
import numpy
import unittest
from pyscf import lib
from pyscf import gto
from pyscf import scf
scf.uhf.BREAKSYM = True
mol = gto.M(
verbose = 7,
output = '/dev/null',
atom = '''
O 0 0 0
H 0 -0.757 0.587
H 0 0.757 0.587''',
basis = 'cc-pvdz',
)
mf = scf.UH... | true | true |
1c0dcae3959d672c03753dd0fad7dd857d81ffbe | 2,275 | py | Python | UI/drawing/MainWindow.py | MarsRobotics/Experiments | 0ada1599766c8ad27fb04398b21042267895c54b | [
"BSD-3-Clause"
] | null | null | null | UI/drawing/MainWindow.py | MarsRobotics/Experiments | 0ada1599766c8ad27fb04398b21042267895c54b | [
"BSD-3-Clause"
] | null | null | null | UI/drawing/MainWindow.py | MarsRobotics/Experiments | 0ada1599766c8ad27fb04398b21042267895c54b | [
"BSD-3-Clause"
] | 2 | 2019-03-28T04:31:05.000Z | 2019-07-03T10:16:20.000Z | __author__ = 'Matt'
try:
# for Python2
from Tkinter import *
except ImportError:
try:
# for Python3
from tkinter import *
except ImportError:
exit()
from TopDisplay import drawWheelDisplay
from RockerBogieSide import drawRockerBogie
from UI.ManualControl import drawManualContro... | 24.202128 | 101 | 0.596044 | __author__ = 'Matt'
try:
from Tkinter import *
except ImportError:
try:
from tkinter import *
except ImportError:
exit()
from TopDisplay import drawWheelDisplay
from RockerBogieSide import drawRockerBogie
from UI.ManualControl import drawManualControl, handleDriveClick
class ... | false | true |
1c0dcb0495164931dec0dcda1d4ed2f64a8f8057 | 1,801 | py | Python | dupsworks/ec2.py | yuki-takei/dupsworks | 6fd18146c111aa0a1e5e16c07fd52f4366a4b0f7 | [
"Apache-2.0"
] | 1 | 2015-06-17T18:25:48.000Z | 2015-06-17T18:25:48.000Z | dupsworks/ec2.py | yuki-takei/dupsworks | 6fd18146c111aa0a1e5e16c07fd52f4366a4b0f7 | [
"Apache-2.0"
] | null | null | null | dupsworks/ec2.py | yuki-takei/dupsworks | 6fd18146c111aa0a1e5e16c07fd52f4366a4b0f7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import boto.ec2
ctx = None
cfg = None
cfg_p = None
cfg_o = None
conn = None
def init(context, connection):
global ctx, cfg, cfg_p, cfg_o
global conn
ctx = context
cfg = ctx.cfg
cfg_p = ctx.cfg_p
cfg_o = ctx.cfg_o
conn = connec... | 23.697368 | 114 | 0.598001 |
import time
import boto.ec2
ctx = None
cfg = None
cfg_p = None
cfg_o = None
conn = None
def init(context, connection):
global ctx, cfg, cfg_p, cfg_o
global conn
ctx = context
cfg = ctx.cfg
cfg_p = ctx.cfg_p
cfg_o = ctx.cfg_o
conn = connection
def set_name(resource, name):
global... | true | true |
1c0dceacc1733d4fc70c1f78f8f926cff005cf83 | 4,758 | py | Python | benchmark/startQiskit_QC1691.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC1691.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_QC1691.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=59
import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from ma... | 33.272727 | 165 | 0.62232 | import cirq
import qiskit
from qiskit import IBMQ
from qiskit.providers.ibmq import least_busy
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
impo... | true | true |
1c0dcec04b64093743480feaf974c601fa8d5932 | 923 | py | Python | SDN/Python_scripts/baseScripts/napalm_interfaceListing.py | CalvinDawgz/Python-Projects | cc5d1e93bcbe124c1864a49cc3dfbca7db520928 | [
"MIT"
] | 1 | 2021-07-10T09:22:55.000Z | 2021-07-10T09:22:55.000Z | SDN/Python_scripts/baseScripts/napalm_interfaceListing.py | CalvinDawgz/Python-Projects | cc5d1e93bcbe124c1864a49cc3dfbca7db520928 | [
"MIT"
] | null | null | null | SDN/Python_scripts/baseScripts/napalm_interfaceListing.py | CalvinDawgz/Python-Projects | cc5d1e93bcbe124c1864a49cc3dfbca7db520928 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from napalm import get_network_driver
import json
from getpass import getpass
deviceList = ['192.168.10.100'
,'192.168.10.101'
,'192.168.10.102'
,'192.168.10.103'
,'192.168.10.104'
]
password = getpass()
for ip in deviceList:
... | 25.638889 | 59 | 0.64247 |
from napalm import get_network_driver
import json
from getpass import getpass
deviceList = ['192.168.10.100'
,'192.168.10.101'
,'192.168.10.102'
,'192.168.10.103'
,'192.168.10.104'
]
password = getpass()
for ip in deviceList:
print("Connecting to ... | true | true |
1c0dcf577ffa9cec57d225a66b1dd6ed71ec600f | 1,510 | py | Python | Algo and DSA/LeetCode-Solutions-master/Python/design-phone-directory.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | Algo and DSA/LeetCode-Solutions-master/Python/design-phone-directory.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | Algo and DSA/LeetCode-Solutions-master/Python/design-phone-directory.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | # init: Time: O(n), Space: O(n)
# get: Time: O(1), Space: O(1)
# check: Time: O(1), Space: O(1)
# release: Time: O(1), Space: O(1)
class PhoneDirectory(object):
def __init__(self, maxNumbers):
"""
Initialize your data structure here
@param maxNumbers - The maximum numbers that... | 26.034483 | 90 | 0.542384 |
class PhoneDirectory(object):
def __init__(self, maxNumbers):
self.__curr = 0
self.__numbers = range(maxNumbers)
self.__used = [False] * maxNumbers
def get(self):
if self.__curr == len(self.__numbers):
return -1
number = self.__numbers[self.__curr]
... | true | true |
1c0dcf6672dbb57576b192cd0778b81c8ccc2ebf | 1,378 | py | Python | tests/test_body.py | kamatash/csv2json | 9135597ed7b368f803afe1dfbd7cd8c539d21ffa | [
"MIT"
] | null | null | null | tests/test_body.py | kamatash/csv2json | 9135597ed7b368f803afe1dfbd7cd8c539d21ffa | [
"MIT"
] | null | null | null | tests/test_body.py | kamatash/csv2json | 9135597ed7b368f803afe1dfbd7cd8c539d21ffa | [
"MIT"
] | null | null | null | import pytest
from csv2json import main
def test_body_success():
lines = ['row1,1', 'row2,2']
header = ['column1', 'column2']
body = main.Body(lines, header)
assert len(body._body) == 2
assert body._body[0]['column1'] == 'row1'
assert body._body[0]['column2'] == '1'
assert body._body[1]['... | 23.355932 | 51 | 0.617562 | import pytest
from csv2json import main
def test_body_success():
lines = ['row1,1', 'row2,2']
header = ['column1', 'column2']
body = main.Body(lines, header)
assert len(body._body) == 2
assert body._body[0]['column1'] == 'row1'
assert body._body[0]['column2'] == '1'
assert body._body[1]['... | true | true |
1c0dcf9fc0f19610f5a9fec55f78448d896c3cda | 1,293 | py | Python | test/language/templates/python/FunctionTemplatedReturnTypeTest.py | dkBrazz/zserio | 29dd8145b7d851fac682d3afe991185ea2eac318 | [
"BSD-3-Clause"
] | 86 | 2018-09-06T09:30:53.000Z | 2022-03-27T01:12:36.000Z | test/language/templates/python/FunctionTemplatedReturnTypeTest.py | dkBrazz/zserio | 29dd8145b7d851fac682d3afe991185ea2eac318 | [
"BSD-3-Clause"
] | 362 | 2018-09-04T20:21:24.000Z | 2022-03-30T15:14:38.000Z | test/language/templates/python/FunctionTemplatedReturnTypeTest.py | dkBrazz/zserio | 29dd8145b7d851fac682d3afe991185ea2eac318 | [
"BSD-3-Clause"
] | 20 | 2018-09-10T15:59:02.000Z | 2021-12-01T15:38:22.000Z | import unittest
import zserio
from testutils import getZserioApi
class FunctionTemplatedReturnTypeTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "templates.zs").function_templated_return_type
def testReadWrite(self):
hasHolder = True
fu... | 41.709677 | 98 | 0.740913 | import unittest
import zserio
from testutils import getZserioApi
class FunctionTemplatedReturnTypeTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "templates.zs").function_templated_return_type
def testReadWrite(self):
hasHolder = True
fu... | true | true |
1c0dd060605d7276388dc49b3075681a11e0abd5 | 4,561 | py | Python | player_reader_2.py | lavinog/7d2d-ttp-reader | 901bd60c95349183d94576c14abfec5662190ffe | [
"MIT"
] | null | null | null | player_reader_2.py | lavinog/7d2d-ttp-reader | 901bd60c95349183d94576c14abfec5662190ffe | [
"MIT"
] | null | null | null | player_reader_2.py | lavinog/7d2d-ttp-reader | 901bd60c95349183d94576c14abfec5662190ffe | [
"MIT"
] | null | null | null | """
Player.ttp player tracker.
Based on Karlovsky120's 7DaysProfileEditor
https://github.com/Karlovsky120/7DaysProfileEditor
Work in progress
"""
from struct import *
import struct
from collections import namedtuple
# replace with file to read (I currently have this hardcoded while testing.)
FILE=r'XXXXXXXXXXXXXXXX... | 32.81295 | 98 | 0.597457 |
from struct import *
import struct
from collections import namedtuple
FILE=r'XXXXXXXXXXXXXXXXX.ttp'
class BinaryReader(object):
def __init__(self, buffer_object):
self._buffer_object=buffer_object
def ReadChar(self):
return unpack('c', self._buffer_object.read(1))[0]
def ReadByte(self):
return u... | true | true |
1c0dd20d08f95af65d7502727021205f4f1c8897 | 20,574 | py | Python | old/old_bin/clt_ar5_model_data_downscaling.py | ua-snap/downscale | 3fe8ea1774cf82149d19561ce5f19b25e6cba6fb | [
"MIT"
] | 5 | 2020-06-24T21:55:12.000Z | 2022-03-23T16:32:54.000Z | snap_scripts/old_scripts/tem_iem_older_scripts_april2018/tem_inputs_iem/old_code/clt_ar5_model_data_downscaling.py | ua-snap/downscale | 3fe8ea1774cf82149d19561ce5f19b25e6cba6fb | [
"MIT"
] | 17 | 2016-01-04T23:37:47.000Z | 2017-04-17T20:57:02.000Z | snap_scripts/old_scripts/tem_iem_older_scripts_april2018/tem_inputs_iem/old_code/clt_ar5_model_data_downscaling.py | ua-snap/downscale | 3fe8ea1774cf82149d19561ce5f19b25e6cba6fb | [
"MIT"
] | 3 | 2020-09-16T04:48:57.000Z | 2021-05-25T03:46:00.000Z | # # # # #
# Tool to downscale the CMIP5 data from the PCMDI group.
# # # # #
def shiftgrid(lon0,datain,lonsin,start=True,cyclic=360.0):
import numpy as np
"""
Shift global lat/lon grid east or west.
.. tabularcolumns:: |l|L|
============== ====================================================
Arguments D... | 44.150215 | 249 | 0.679061 | def shiftgrid(lon0,datain,lonsin,start=True,cyclic=360.0):
import numpy as np
if np.fabs(lonsin[-1]-lonsin[0]-cyclic) > 1.e-4:
start_idx = 0
else:
start_idx = 1
if lon0 < lonsin[0] or lon0 > lonsin[-1]:
raise ValueError('lon0 outside of range of lonsin')
i0 = np.argmin(np.fabs(lonsin-lon0))
i0_shift = l... | true | true |
1c0dd2a645dc9370ca7a05a72c77de20587253cd | 3,296 | py | Python | sitioWeb/SucursalB/models.py | UnopposedQuill/muedatos2 | f861fac5b5f6bc67add69e3fc8a8ead3901fc24b | [
"MIT"
] | null | null | null | sitioWeb/SucursalB/models.py | UnopposedQuill/muedatos2 | f861fac5b5f6bc67add69e3fc8a8ead3901fc24b | [
"MIT"
] | null | null | null | sitioWeb/SucursalB/models.py | UnopposedQuill/muedatos2 | f861fac5b5f6bc67add69e3fc8a8ead3901fc24b | [
"MIT"
] | null | null | null | from django.db import models
## SucursalB
class SBCliente(models.Model):
idcliente = models.AutoField(db_column='idCliente', primary_key=True) # Field name made lowercase.
nombre = models.CharField(max_length=30)
apellidos = models.CharField(max_length=30)
ubicacionLat = models.FloatField() # This fi... | 41.2 | 146 | 0.712379 | from django.db import models
class SBCliente(models.Model):
idcliente = models.AutoField(db_column='idCliente', primary_key=True) nombre = models.CharField(max_length=30)
apellidos = models.CharField(max_length=30)
ubicacionLat = models.FloatField() ubicacionLong = models.FloatField() direcc... | true | true |
1c0dd3c15b148dea19900236c272006638f50dd0 | 7,312 | py | Python | python_logging_rabbitmq/handlers.py | makimo/python-logging-rabbitmq | 01f0a40c1fe9a62f7bdcfe99859604496a1f4d97 | [
"MIT"
] | null | null | null | python_logging_rabbitmq/handlers.py | makimo/python-logging-rabbitmq | 01f0a40c1fe9a62f7bdcfe99859604496a1f4d97 | [
"MIT"
] | null | null | null | python_logging_rabbitmq/handlers.py | makimo/python-logging-rabbitmq | 01f0a40c1fe9a62f7bdcfe99859604496a1f4d97 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
from copy import copy
import pika
from django.views.debug import ExceptionReporter
from pika import credentials
from .filters import FieldFilter
from .formatters import JSONFormatter
class RabbitMQHandler(logging.Handler):
"""
Python/Django logging handler to ship logs... | 38.083333 | 121 | 0.608178 | import logging
from copy import copy
import pika
from django.views.debug import ExceptionReporter
from pika import credentials
from .filters import FieldFilter
from .formatters import JSONFormatter
class RabbitMQHandler(logging.Handler):
def __init__(self, level=logging.NOTSET, formatter=None,
... | true | true |
1c0dd56c7673e8178f6d85efce3423ceb68deb3c | 9,813 | py | Python | utils/views/report.py | DiscordGIR/ChromeyRewrite | 9ca889220f5fb29cb16c99c29c54b945c9d843f8 | [
"MIT"
] | null | null | null | utils/views/report.py | DiscordGIR/ChromeyRewrite | 9ca889220f5fb29cb16c99c29c54b945c9d843f8 | [
"MIT"
] | null | null | null | utils/views/report.py | DiscordGIR/ChromeyRewrite | 9ca889220f5fb29cb16c99c29c54b945c9d843f8 | [
"MIT"
] | null | null | null | import discord
from discord import ui
from discord.ext.commands import Context
import pytimeparse
from data.services.guild_service import guild_service
from utils.context import ChromeyOldContext, PromptData
from utils.mod.global_modactions import ban, mute, unmute, warn
from utils.permissions.permissions import permis... | 46.070423 | 328 | 0.644146 | import discord
from discord import ui
from discord.ext.commands import Context
import pytimeparse
from data.services.guild_service import guild_service
from utils.context import ChromeyOldContext, PromptData
from utils.mod.global_modactions import ban, mute, unmute, warn
from utils.permissions.permissions import permis... | true | true |
1c0dd590d5edddb7ff7cfdd5a44774bba9a50649 | 2,373 | py | Python | src/add_subgroup_info.py | zouwenjiao/DSCI_522_Group304 | fe03bcff23cced5b9934e959355e3bb4e4af007d | [
"MIT"
] | null | null | null | src/add_subgroup_info.py | zouwenjiao/DSCI_522_Group304 | fe03bcff23cced5b9934e959355e3bb4e4af007d | [
"MIT"
] | 57 | 2020-01-15T04:40:59.000Z | 2020-02-13T00:28:33.000Z | src/add_subgroup_info.py | zouwenjiao/DSCI_522_Group304 | fe03bcff23cced5b9934e959355e3bb4e4af007d | [
"MIT"
] | 13 | 2020-01-15T04:52:04.000Z | 2020-11-27T03:45:37.000Z | # author: Group 304 (Anny Chih)
# date: 2020-02-04
"""This script takes in a cleaned datafile and
adds a column of values indicating if the school has BOTH Aboriginal and Non Aboriginal Students
Usage: add_subgroup_info.py --clean_data=<clean_data> --new_data=<new_data>
Options:
--clean_data=<clean_data> local pat... | 36.507692 | 144 | 0.741256 |
import os
import pandas as pd
from docopt import docopt
opt = docopt(__doc__)
def check_path():
if (os.path.exists(opt["--clean_data"])):
pass
else:
raise ValueError('The clean_data file cannot be found. Please check the path provided.')
check_path()
def main(clean_data, new_data):
data = pd.... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.