hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72c4d0057651aa215322c6c946998d0af458554 | 753 | py | Python | merge_intervals.py | gvalleru/interview_q_py3 | 5ca71ec603610a4dc7baeb9c429b852d97ae3cb9 | [
"Apache-2.0"
] | null | null | null | merge_intervals.py | gvalleru/interview_q_py3 | 5ca71ec603610a4dc7baeb9c429b852d97ae3cb9 | [
"Apache-2.0"
] | null | null | null | merge_intervals.py | gvalleru/interview_q_py3 | 5ca71ec603610a4dc7baeb9c429b852d97ae3cb9 | [
"Apache-2.0"
] | null | null | null | # Interval class which converts
class Interval:
def __init__(self, interval_=[0, 0]):
self.start = interval_[0]
self.end = interval_[1]
def __repr__(self):
return '[{}, {}]'.format(self.start, self.end)
class Solution:
def merge(self, intervals):
intervals = [Interval(i) f... | 28.961538 | 68 | 0.536521 |
class Interval:
def __init__(self, interval_=[0, 0]):
self.start = interval_[0]
self.end = interval_[1]
def __repr__(self):
return '[{}, {}]'.format(self.start, self.end)
class Solution:
def merge(self, intervals):
intervals = [Interval(i) for i in intervals]
inte... | false | true |
f72c4d210b5eea32e3d333a149d7cfd14424c8d5 | 14,927 | py | Python | uf/application/uda.py | yupeijei1997/unif | 16685a89446e6ce14080439162a9bfd0c75f0521 | [
"Apache-2.0"
] | 1 | 2021-05-15T12:07:40.000Z | 2021-05-15T12:07:40.000Z | uf/application/uda.py | yupeijei1997/unif | 16685a89446e6ce14080439162a9bfd0c75f0521 | [
"Apache-2.0"
] | null | null | null | uf/application/uda.py | yupeijei1997/unif | 16685a89446e6ce14080439162a9bfd0c75f0521 | [
"Apache-2.0"
] | null | null | null | # coding:=utf-8
# Copyright 2021 Tencent. 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 applic... | 38.872396 | 79 | 0.586923 |
import numpy as np
from uf.tools import tf
from .base import ClassifierModule
from .bert import BERTClassifier, get_bert_config, get_key_to_depths
from uf.modeling.bert import BERTEncoder
from uf.modeling.uda import UDADecoder
from uf.tokenization.word_piece import get_word_piece_tokenizer
import uf.uti... | true | true |
f72c4da207cd6d82929af064fa9ceebeef08defa | 283 | py | Python | iterators_and_generators/demo_generators.py | Minkov/python-oop-2020-02 | d2acb1504c1a135cded2ae6ff42acccb303d9ab1 | [
"MIT"
] | 2 | 2020-02-27T18:34:45.000Z | 2020-10-25T17:34:15.000Z | iterators_and_generators/demo_generators.py | Minkov/python-oop-2020-02 | d2acb1504c1a135cded2ae6ff42acccb303d9ab1 | [
"MIT"
] | null | null | null | iterators_and_generators/demo_generators.py | Minkov/python-oop-2020-02 | d2acb1504c1a135cded2ae6ff42acccb303d9ab1 | [
"MIT"
] | null | null | null | def custom_range(min, max):
index = min
while index <= max:
yield index
index += 1
it = custom_range(1, 2)
print(next(it))
print(next(it))
print((x for x in range(3)))
even = filter(lambda x: x % 2 == 0, range(10))
for x in even:
print(x) | 18.866667 | 47 | 0.55477 | def custom_range(min, max):
index = min
while index <= max:
yield index
index += 1
it = custom_range(1, 2)
print(next(it))
print(next(it))
print((x for x in range(3)))
even = filter(lambda x: x % 2 == 0, range(10))
for x in even:
print(x) | true | true |
f72c4f1fb0a457648028cbec2b488d34d23bde73 | 5,745 | py | Python | logistic_fit.py | ege-erdil/logistic-fit | 7c6cc9ed35877ed8d142dd75b7b98658e19cf7cb | [
"MIT"
] | null | null | null | logistic_fit.py | ege-erdil/logistic-fit | 7c6cc9ed35877ed8d142dd75b7b98658e19cf7cb | [
"MIT"
] | null | null | null | logistic_fit.py | ege-erdil/logistic-fit | 7c6cc9ed35877ed8d142dd75b7b98658e19cf7cb | [
"MIT"
] | null | null | null | from autograd import grad
import autograd.numpy as np
from scipy.stats import logistic, norm
from scipy.optimize import minimize
def logistic_pdf(x, loc, scale):
y = (x - loc)/scale
return np.exp(-y)/(scale * (1 + np.exp(-y))**2)
def logistic_cdf(x, loc, scale):
y = (x-loc)/scale
if y < -10... | 33.794118 | 132 | 0.582594 | from autograd import grad
import autograd.numpy as np
from scipy.stats import logistic, norm
from scipy.optimize import minimize
def logistic_pdf(x, loc, scale):
y = (x - loc)/scale
return np.exp(-y)/(scale * (1 + np.exp(-y))**2)
def logistic_cdf(x, loc, scale):
y = (x-loc)/scale
if y < -10... | true | true |
f72c4f3b403c785cc891e829c3dd7d88ad7ca116 | 308 | py | Python | tests/parser_test.py | krilifon/proxy-parse | 79d1c1655024a03e7a8c1b653dfdf6d68f89e511 | [
"MIT"
] | 4 | 2021-11-29T18:56:54.000Z | 2021-12-23T10:59:58.000Z | tests/parser_test.py | krilifon/proxy-parse | 79d1c1655024a03e7a8c1b653dfdf6d68f89e511 | [
"MIT"
] | null | null | null | tests/parser_test.py | krilifon/proxy-parse | 79d1c1655024a03e7a8c1b653dfdf6d68f89e511 | [
"MIT"
] | null | null | null | from proxy_parse import ProxyParser
from proxy_parse.spiders import HideMySpider
def test_proxy_parser():
proxy_parser = ProxyParser(scrapy_spiders=[HideMySpider])
result = proxy_parser.parse()
assert type(result) is list
assert all(type(proxy) is str and ":" in proxy for proxy in result)
| 30.8 | 71 | 0.762987 | from proxy_parse import ProxyParser
from proxy_parse.spiders import HideMySpider
def test_proxy_parser():
proxy_parser = ProxyParser(scrapy_spiders=[HideMySpider])
result = proxy_parser.parse()
assert type(result) is list
assert all(type(proxy) is str and ":" in proxy for proxy in result)
| true | true |
f72c50b550d0cb981526fc944b9967a3ca63e4c6 | 237 | py | Python | polyaxon/api/code_reference/serializers.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | polyaxon/api/code_reference/serializers.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | polyaxon/api/code_reference/serializers.py | elyase/polyaxon | 1c19f059a010a6889e2b7ea340715b2bcfa382a0 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from db.models.repos import CodeReference
class CodeReferenceSerializer(serializers.ModelSerializer):
class Meta:
model = CodeReference
exclude = ['created_at', 'updated_at']
| 23.7 | 59 | 0.755274 | from rest_framework import serializers
from db.models.repos import CodeReference
class CodeReferenceSerializer(serializers.ModelSerializer):
class Meta:
model = CodeReference
exclude = ['created_at', 'updated_at']
| true | true |
f72c516d329c6cda5c8629429947754fd975930b | 458 | py | Python | .venv/lib/python3.7/site-packages/jupyter_client/__init__.py | ITCRStevenLPZ/Proyecto2-Analisis-de-Algoritmos | 4acdbc423428fb2e0068720add69e7870c87929a | [
"Apache-2.0"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | .venv/lib/python3.7/site-packages/jupyter_client/__init__.py | ITCRStevenLPZ/Proyecto2-Analisis-de-Algoritmos | 4acdbc423428fb2e0068720add69e7870c87929a | [
"Apache-2.0"
] | 24 | 2020-03-25T19:35:43.000Z | 2022-02-10T11:46:50.000Z | .venv/lib/python3.7/site-packages/jupyter_client/__init__.py | ITCRStevenLPZ/Proyecto2-Analisis-de-Algoritmos | 4acdbc423428fb2e0068720add69e7870c87929a | [
"Apache-2.0"
] | 11 | 2019-01-21T17:51:48.000Z | 2021-08-10T07:04:33.000Z | """Client-side implementations of the Jupyter protocol"""
from ._version import version_info, __version__, protocol_version_info, protocol_version
from .connect import *
from .launcher import *
from .client import KernelClient
from .manager import KernelManager, AsyncKernelManager, run_kernel
from .blocking import Blo... | 41.636364 | 88 | 0.851528 |
from ._version import version_info, __version__, protocol_version_info, protocol_version
from .connect import *
from .launcher import *
from .client import KernelClient
from .manager import KernelManager, AsyncKernelManager, run_kernel
from .blocking import BlockingKernelClient
from .asynchronous import AsyncKernelCli... | true | true |
f72c517b8635ba9e8ee1d7ac3aac00b5ef74b266 | 475 | py | Python | src/som/primitives/invokable_primitives.py | smarr/RPySOM | 941e1fe08753d6e97dac24c3ba4d1e99a9c40160 | [
"MIT"
] | 12 | 2016-01-07T14:20:57.000Z | 2019-10-13T06:56:20.000Z | src/som/primitives/invokable_primitives.py | smarr/RPySOM | 941e1fe08753d6e97dac24c3ba4d1e99a9c40160 | [
"MIT"
] | 2 | 2016-05-26T06:53:33.000Z | 2020-09-02T15:58:28.000Z | src/som/primitives/invokable_primitives.py | SOM-st/RPySOM | 2dcfc71786a3bd5be5a842c649645f71d6c35f89 | [
"MIT"
] | 2 | 2016-05-25T06:07:52.000Z | 2019-10-02T16:52:25.000Z | from som.primitives.primitives import Primitives
from som.vmobjects.primitive import UnaryPrimitive
def _holder(rcvr):
return rcvr.get_holder()
def _signature(rcvr):
return rcvr.get_signature()
class InvokablePrimitivesBase(Primitives):
def install_primitives(self):
self._install_instance_prim... | 27.941176 | 97 | 0.785263 | from som.primitives.primitives import Primitives
from som.vmobjects.primitive import UnaryPrimitive
def _holder(rcvr):
return rcvr.get_holder()
def _signature(rcvr):
return rcvr.get_signature()
class InvokablePrimitivesBase(Primitives):
def install_primitives(self):
self._install_instance_prim... | true | true |
f72c517f1ba15c39ff29e590665a48a098bdbe9a | 868 | py | Python | Aula_extrator_url/main.py | laurourbano/Projetos_Python | 50e7f4a7ff34158385ea7b635bac95ec8a0363a1 | [
"MIT"
] | 1 | 2021-12-28T02:51:34.000Z | 2021-12-28T02:51:34.000Z | Aula_extrator_url/main.py | laurourbano/Projetos_Python | 50e7f4a7ff34158385ea7b635bac95ec8a0363a1 | [
"MIT"
] | null | null | null | Aula_extrator_url/main.py | laurourbano/Projetos_Python | 50e7f4a7ff34158385ea7b635bac95ec8a0363a1 | [
"MIT"
] | null | null | null | # Arquivo utilizado até a aula 3, quando então passamos a utilizar a classe
# ExtratorURL no arquivo extrator_url.py
url = "bytebank.com/cambio?quantidade=100&moedaOrigem=real&moedaDestino=dolar"
# Sanitização da URL
url = url.strip()
# Validação da URL
if url == "":
raise ValueError("A URL está vazia")
# Separa... | 31 | 78 | 0.776498 |
url = "bytebank.com/cambio?quantidade=100&moedaOrigem=real&moedaDestino=dolar"
url = url.strip()
if url == "":
raise ValueError("A URL está vazia")
indice_interrogacao = url.find('?')
url_base = url[:indice_interrogacao]
url_parametros = url[indice_interrogacao+1:]
print(url_parametros)
parametro_busca = ... | true | true |
f72c51acdba5f7032ff01e97210db5d3fb75c607 | 8,224 | py | Python | conda/cli/main.py | jacoblsmith/conda | f50b919a4c923820c1bb2b449603534084faa28b | [
"BSD-3-Clause"
] | null | null | null | conda/cli/main.py | jacoblsmith/conda | f50b919a4c923820c1bb2b449603534084faa28b | [
"BSD-3-Clause"
] | null | null | null | conda/cli/main.py | jacoblsmith/conda | f50b919a4c923820c1bb2b449603534084faa28b | [
"BSD-3-Clause"
] | null | null | null | # (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
'''conda is a tool for managing environments and packages.
conda provides the following commands:
... | 35.601732 | 105 | 0.655399 |
from __future__ import print_function, division, absolute_import
import sys
def main():
if len(sys.argv) > 1:
argv1 = sys.argv[1]
if argv1 in ('..activate', '..deactivate', '..activateroot', '..checkenv'):
import conda.cli.activate as activate
activate.main()
... | true | true |
f72c52094e0d1fefbdc0188332f4f3efdc92129b | 4,055 | py | Python | semantic-conventions/src/opentelemetry/semconv/model/constraints.py | bogdandrutu/build-tools | 08bec45f36f112751a2ea0785368a4fa8e2add6a | [
"Apache-2.0"
] | null | null | null | semantic-conventions/src/opentelemetry/semconv/model/constraints.py | bogdandrutu/build-tools | 08bec45f36f112751a2ea0785368a4fa8e2add6a | [
"Apache-2.0"
] | null | null | null | semantic-conventions/src/opentelemetry/semconv/model/constraints.py | bogdandrutu/build-tools | 08bec45f36f112751a2ea0785368a4fa8e2add6a | [
"Apache-2.0"
] | null | null | null | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 41.377551 | 119 | 0.67349 |
from dataclasses import dataclass, field, replace
from typing import List, Tuple, Set
from opentelemetry.semconv.model.exceptions import ValidationError
from opentelemetry.semconv.model.semantic_attribute import SemanticAttribute
from opentelemetry.semconv.model.utils import validate_values
from ruamel.... | true | true |
f72c526d85a4169c9d8e5811a9e733fff90c8df8 | 3,136 | py | Python | gitea_api/models/issue_labels_option.py | r7l/python-gitea-api | 31d3dba27ea7e551e2048a1230c4ab4d73365006 | [
"MIT"
] | 1 | 2022-02-09T23:43:26.000Z | 2022-02-09T23:43:26.000Z | gitea_api/models/issue_labels_option.py | r7l/python-gitea-api | 31d3dba27ea7e551e2048a1230c4ab4d73365006 | [
"MIT"
] | null | null | null | gitea_api/models/issue_labels_option.py | r7l/python-gitea-api | 31d3dba27ea7e551e2048a1230c4ab4d73365006 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Gitea API.
This documentation describes the Gitea API. # noqa: E501
OpenAPI spec version: 1.16.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class IssueLabelsOption(object):
"""NOTE: This class ... | 27.752212 | 80 | 0.552934 |
import pprint
import re
import six
class IssueLabelsOption(object):
swagger_types = {
'labels': 'list[int]'
}
attribute_map = {
'labels': 'labels'
}
def __init__(self, labels=None):
self._labels = None
self.discriminator = None
if labels is not None... | true | true |
f72c52cdd198823444e5eba59c73f88ccbadef74 | 3,334 | py | Python | benchmark/startCirq3299.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3299.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3299.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=45
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 37.044444 | 77 | 0.678164 |
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
from cirq.contrib.svg import SVGCircuit
def make_circuit(n: int, input_qubit):
c = cirq.Circuit()
c.append(cirq.H.on(input_qubit[0]))
c.append(cirq.H.on(input_qubit[1]))
... | true | true |
f72c52e95f901b6fd8527d85d0d774d80df5f455 | 842 | py | Python | zeeguu/api/api/teacher_dashboard/student_words.py | mircealungu/Zeeguu-API-2 | 1e8ea7f5dd0b883ed2d714b9324162b1a8edd170 | [
"MIT"
] | 8 | 2018-02-06T15:47:55.000Z | 2021-05-26T15:24:49.000Z | zeeguu/api/api/teacher_dashboard/student_words.py | mircealungu/Zeeguu-API-2 | 1e8ea7f5dd0b883ed2d714b9324162b1a8edd170 | [
"MIT"
] | 57 | 2018-02-02T19:54:38.000Z | 2021-07-15T15:45:15.000Z | zeeguu/api/api/teacher_dashboard/student_words.py | mircealungu/Zeeguu-API-2 | 1e8ea7f5dd0b883ed2d714b9324162b1a8edd170 | [
"MIT"
] | 13 | 2017-10-12T09:05:19.000Z | 2020-02-19T09:38:01.000Z | import zeeguu.core
from zeeguu.core.sql.learner.words import words_not_studied, learned_words
from ._common_api_parameters import _get_student_cohort_and_period_from_POST_params
from .. import api, json_result, with_session
db = zeeguu.core.db
@api.route("/student_words_not_studied", methods=["POST"])
@with_session
... | 35.083333 | 88 | 0.800475 | import zeeguu.core
from zeeguu.core.sql.learner.words import words_not_studied, learned_words
from ._common_api_parameters import _get_student_cohort_and_period_from_POST_params
from .. import api, json_result, with_session
db = zeeguu.core.db
@api.route("/student_words_not_studied", methods=["POST"])
@with_session
... | true | true |
f72c53192b9962222a935bcba714f77187770d13 | 186 | py | Python | Reliability_Tests/ex78.py | dieterch/dReliaCalc | 1e0a06e904f3a60527c3a6ae0f45c666a9b48128 | [
"MIT"
] | null | null | null | Reliability_Tests/ex78.py | dieterch/dReliaCalc | 1e0a06e904f3a60527c3a6ae0f45c666a9b48128 | [
"MIT"
] | null | null | null | Reliability_Tests/ex78.py | dieterch/dReliaCalc | 1e0a06e904f3a60527c3a6ae0f45c666a9b48128 | [
"MIT"
] | null | null | null | from reliability.Reliability_testing import one_sample_proportion
result = one_sample_proportion(trials=30, successes=29)
print(result)
'''
(0.8278305443665873, 0.9991564290733695)
'''
| 23.25 | 65 | 0.817204 | from reliability.Reliability_testing import one_sample_proportion
result = one_sample_proportion(trials=30, successes=29)
print(result)
| true | true |
f72c533b9f24bb347b96c3082d58404f5c3dff10 | 592 | py | Python | examples/display_feed_example.py | UniquePassive/randcam | 7c8dc977cfaf5eddb9b06f6280ab268526114d40 | [
"Apache-2.0"
] | 1 | 2018-06-04T04:10:06.000Z | 2018-06-04T04:10:06.000Z | examples/display_feed_example.py | UniquePassive/randcam | 7c8dc977cfaf5eddb9b06f6280ab268526114d40 | [
"Apache-2.0"
] | null | null | null | examples/display_feed_example.py | UniquePassive/randcam | 7c8dc977cfaf5eddb9b06f6280ab268526114d40 | [
"Apache-2.0"
] | 1 | 2018-06-04T04:10:07.000Z | 2018-06-04T04:10:07.000Z | import cv2
import binascii
from randcam import RandCam
with RandCam(0, True) as rc:
result, random = rc.seed()
while True:
result, image = rc.feed.read()
cv2.imshow('Captured Image', image)
key = cv2.waitKey(1)
# 'S' key - reseed
if key == ord('s'):
... | 29.6 | 86 | 0.554054 | import cv2
import binascii
from randcam import RandCam
with RandCam(0, True) as rc:
result, random = rc.seed()
while True:
result, image = rc.feed.read()
cv2.imshow('Captured Image', image)
key = cv2.waitKey(1)
if key == ord('s'):
result, rand... | true | true |
f72c534e1699dc5a2e1677045e0d3915c236a50b | 12,873 | py | Python | info_summary/get_summary_pdf.py | Dangaran/home_station_project | 890b342e79e3dd493a8f418ed9283f0d444e5073 | [
"CC0-1.0"
] | null | null | null | info_summary/get_summary_pdf.py | Dangaran/home_station_project | 890b342e79e3dd493a8f418ed9283f0d444e5073 | [
"CC0-1.0"
] | null | null | null | info_summary/get_summary_pdf.py | Dangaran/home_station_project | 890b342e79e3dd493a8f418ed9283f0d444e5073 | [
"CC0-1.0"
] | null | null | null | import requests
import pandas as pd
from plotnine import *
import json
import time
from fpdf import FPDF
from datetime import datetime
# change pandas display options
pd.options.display.max_columns = 101
pd.options.display.max_rows = 200
pd.options.display.precision = 7
# get aemet and home information
last_day = {
... | 45.487633 | 210 | 0.607395 | import requests
import pandas as pd
from plotnine import *
import json
import time
from fpdf import FPDF
from datetime import datetime
pd.options.display.max_columns = 101
pd.options.display.max_rows = 200
pd.options.display.precision = 7
last_day = {
'date_start': int(time.time()) - 86400,
'date_end': int... | true | true |
f72c5491decdb5fc627448e653e80715d6890df3 | 473 | py | Python | duck/FlyBehavior.py | rinman24/headfirst-python | 1c6a12dc04475fae06e333a9abcdefee0bdda5d6 | [
"MIT"
] | null | null | null | duck/FlyBehavior.py | rinman24/headfirst-python | 1c6a12dc04475fae06e333a9abcdefee0bdda5d6 | [
"MIT"
] | null | null | null | duck/FlyBehavior.py | rinman24/headfirst-python | 1c6a12dc04475fae06e333a9abcdefee0bdda5d6 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
# abstract class
class FlyBehavior(ABC):
@staticmethod
@abstractmethod
def fly():
pass
# Concrete implementations
class FlyWithWings(FlyBehavior):
@staticmethod
def fly():
print("I'm flying!!")
class FlyNoWay(FlyBehavior):
@staticmethod
... | 18.92 | 42 | 0.649049 | from abc import ABC, abstractmethod
class FlyBehavior(ABC):
@staticmethod
@abstractmethod
def fly():
pass
class FlyWithWings(FlyBehavior):
@staticmethod
def fly():
print("I'm flying!!")
class FlyNoWay(FlyBehavior):
@staticmethod
def fly():
print("I can't fly.")
... | true | true |
f72c564b609e2ec63105a6116e9ade4a3f942eae | 1,684 | py | Python | api/chat_api/migrations/0001_create_message_model.py | gda2048/ChatAPI | 6efab6fb5b9d1ff74b44075cd2d13cbb6cd06189 | [
"MIT"
] | null | null | null | api/chat_api/migrations/0001_create_message_model.py | gda2048/ChatAPI | 6efab6fb5b9d1ff74b44075cd2d13cbb6cd06189 | [
"MIT"
] | 5 | 2020-06-06T01:18:14.000Z | 2021-06-10T19:45:08.000Z | api/chat_api/migrations/0001_create_message_model.py | gda2048/ChatAPI | 6efab6fb5b9d1ff74b44075cd2d13cbb6cd06189 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2020-02-04 21:51
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 46.777778 | 190 | 0.64905 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | true | true |
f72c5744bbab84a804af1d39c17f0245e4c8220a | 19,980 | py | Python | Tools/python37/Lib/textwrap.py | xxroot/android_universal | af2d8627182f936383d792c1f775d87da50f2f6d | [
"MIT"
] | 207 | 2018-10-01T08:53:01.000Z | 2022-03-14T12:15:54.000Z | Tools/python37/Lib/textwrap.py | xxroot/android_universal | af2d8627182f936383d792c1f775d87da50f2f6d | [
"MIT"
] | 8 | 2019-06-29T14:18:51.000Z | 2022-02-19T07:30:27.000Z | Tools/python37/Lib/textwrap.py | xxroot/android_universal | af2d8627182f936383d792c1f775d87da50f2f6d | [
"MIT"
] | 76 | 2020-03-16T01:47:46.000Z | 2022-03-21T16:37:07.000Z | """Text wrapping and filling.
"""
# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent', 'shorten']
# Hardcode the recognized whitespace characters ... | 41.026694 | 81 | 0.565716 |
import re
__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent', 'shorten']
_whitespace = '\t\n\x0b\x0c\r '
class TextWrapper:
unicode_whitespace_trans = {}
uspace = ord(' ')
for x in _whitespace:
unicode_whitespace_trans[ord(x)] = uspace
... | true | true |
f72c58b092c81a2ecfe08da7855f4be4cca37499 | 104,175 | py | Python | game2d.py | JeffreyTsang/Brickbreaker | 37f0d143e9f937027fc281aef1511d0e9c804b8b | [
"MIT"
] | null | null | null | game2d.py | JeffreyTsang/Brickbreaker | 37f0d143e9f937027fc281aef1511d0e9c804b8b | [
"MIT"
] | null | null | null | game2d.py | JeffreyTsang/Brickbreaker | 37f0d143e9f937027fc281aef1511d0e9c804b8b | [
"MIT"
] | null | null | null | # game2d.py
# Walker M. White (wmw2)
# November 14, 2015
"""Module to provide simple 2D game support.
This module provides all of the classes that are to use (or subclass) to create your game.
DO NOT MODIFY THE CODE IN THIS FILE. See the online documentation in Assignment 7 for
more guidance. It includes informati... | 36.902232 | 109 | 0.596304 |
"""Module to provide simple 2D game support.
This module provides all of the classes that are to use (or subclass) to create your game.
DO NOT MODIFY THE CODE IN THIS FILE. See the online documentation in Assignment 7 for
more guidance. It includes information not displayed in this module."""
import kivy
impo... | false | true |
f72c596ca53720016e67120b1a4e92b4a9a60f51 | 2,775 | py | Python | training/utils/utils.py | Tbarkin121/Tensegrity_IsaacGym | 0b6b5227e76b18396862c242a4e8e743248844b3 | [
"MIT"
] | 317 | 2021-09-08T01:28:49.000Z | 2022-03-31T07:52:36.000Z | training/utils/utils.py | Tbarkin121/Tensegrity_IsaacGym | 0b6b5227e76b18396862c242a4e8e743248844b3 | [
"MIT"
] | 24 | 2021-11-05T14:15:47.000Z | 2022-03-31T11:58:18.000Z | training/utils/utils.py | Tbarkin121/Tensegrity_IsaacGym | 0b6b5227e76b18396862c242a4e8e743248844b3 | [
"MIT"
] | 58 | 2021-10-31T07:15:43.000Z | 2022-03-29T14:51:02.000Z | # Copyright (c) 2018-2021, NVIDIA Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condit... | 39.084507 | 91 | 0.728649 |
import numpy as np
import torch
import random
import os
def set_np_formatting():
np.set_printoptions(edgeitems=30, infstr='inf',
linewidth=4000, nanstr='nan', precision=2,
suppress=False, threshold=10000, formatter=None)
def set_seed(s... | true | true |
f72c59b6c86d8d1a0d95172b56d5bdce1315051e | 32,056 | py | Python | scripts/automation/trex_control_plane/interactive/trex/console/trex_console.py | klement/trex-core | b98e2e6d2b8c6caeb233ce36fcbc131ffc45e35e | [
"Apache-2.0"
] | 1 | 2020-09-06T00:58:34.000Z | 2020-09-06T00:58:34.000Z | scripts/automation/trex_control_plane/interactive/trex/console/trex_console.py | klement/trex-core | b98e2e6d2b8c6caeb233ce36fcbc131ffc45e35e | [
"Apache-2.0"
] | null | null | null | scripts/automation/trex_control_plane/interactive/trex/console/trex_console.py | klement/trex-core | b98e2e6d2b8c6caeb233ce36fcbc131ffc45e35e | [
"Apache-2.0"
] | 1 | 2021-09-13T13:43:10.000Z | 2021-09-13T13:43:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Dan Klein, Itay Marom
Cisco Systems, Inc.
Copyright (c) 2015-2015 Cisco Systems, 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://ww... | 32.088088 | 153 | 0.551816 |
from __future__ import print_function
import collections
import subprocess
import inspect
import cmd
import json
import argparse
import random
import readline
import string
import os
import sys
import tty, termios
from threading import Lock
from functools import wraps, partial
import threading
import atexit
import ... | true | true |
f72c59dd8ce767d14399213927b2439b6c5d6359 | 5,582 | bzl | Python | external_plugin_deps.bzl | davido/plugins_saml | a876ef94a1a2988882bca9665356dd90628a828e | [
"Apache-2.0"
] | null | null | null | external_plugin_deps.bzl | davido/plugins_saml | a876ef94a1a2988882bca9665356dd90628a828e | [
"Apache-2.0"
] | null | null | null | external_plugin_deps.bzl | davido/plugins_saml | a876ef94a1a2988882bca9665356dd90628a828e | [
"Apache-2.0"
] | null | null | null | load("//tools/bzl:maven_jar.bzl", "maven_jar")
SHIBBOLETH = "https://build.shibboleth.net/nexus/content/repositories/releases/"
OPENSAML_VERSION = "3.4.3"
PAC4J_VERSION = "3.8.0"
def external_plugin_deps():
# Transitive dependency of velocity
maven_jar(
name = "commons-collections",
artifact... | 30.67033 | 80 | 0.640989 | load("//tools/bzl:maven_jar.bzl", "maven_jar")
SHIBBOLETH = "https://build.shibboleth.net/nexus/content/repositories/releases/"
OPENSAML_VERSION = "3.4.3"
PAC4J_VERSION = "3.8.0"
def external_plugin_deps():
maven_jar(
name = "commons-collections",
artifact = "commons-collections:commons-col... | true | true |
f72c5a8f517248059d2b01dd023847f9b1fa269d | 2,726 | py | Python | django_project/store_cms/settings/base.py | Chumbak/RetailstoreTV-Content-Player | ea26f14045c3d30a2e348abac4d0a0c8df171b4b | [
"Apache-2.0"
] | 2 | 2017-08-31T10:35:47.000Z | 2017-11-10T07:03:43.000Z | django_project/store_cms/settings/base.py | Chumbak/RetailstoreTV-Content-Player | ea26f14045c3d30a2e348abac4d0a0c8df171b4b | [
"Apache-2.0"
] | null | null | null | django_project/store_cms/settings/base.py | Chumbak/RetailstoreTV-Content-Player | ea26f14045c3d30a2e348abac4d0a0c8df171b4b | [
"Apache-2.0"
] | 5 | 2017-08-31T09:53:12.000Z | 2018-08-02T04:26:32.000Z | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
SECRET_KEY = os.environ['S... | 25.240741 | 91 | 0.696992 | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.environ['SECRET_KEY']
DEBUG = bool(os.environ.get('DEBUG', False))
ALLOWED_HOSTS = []
DJANGO_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contri... | true | true |
f72c5b38b7252471247fc6364be4f544e55a623c | 1,047 | py | Python | Day_23/car_manager.py | johnsons-ux/100-days-of-python | 59f8f5b1be85542306103df44383423b00e48931 | [
"CC0-1.0"
] | 1 | 2022-03-12T07:17:56.000Z | 2022-03-12T07:17:56.000Z | Day_23/car_manager.py | johnsons-ux/100-days-of-python | 59f8f5b1be85542306103df44383423b00e48931 | [
"CC0-1.0"
] | null | null | null | Day_23/car_manager.py | johnsons-ux/100-days-of-python | 59f8f5b1be85542306103df44383423b00e48931 | [
"CC0-1.0"
] | null | null | null | from turtle import Turtle
import random
COLORS = ['red', 'orange', 'yellow', 'green', 'blue', 'purple']
STARTING_MOVE_DISTANCE = 5
MOVE_INCREMENT = 10
class CarManager:
def __init__(self):
self.all_cars = []
self.car_speed = STARTING_MOVE_DISTANCE
def create_car(self):
random_chance... | 30.794118 | 115 | 0.619866 | from turtle import Turtle
import random
COLORS = ['red', 'orange', 'yellow', 'green', 'blue', 'purple']
STARTING_MOVE_DISTANCE = 5
MOVE_INCREMENT = 10
class CarManager:
def __init__(self):
self.all_cars = []
self.car_speed = STARTING_MOVE_DISTANCE
def create_car(self):
random_chance... | true | true |
f72c5ca5cbb2721d967ad9ef9dfa896f7ccce240 | 2,924 | py | Python | tensorflow/python/estimator/canned/optimizers.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/python/estimator/canned/optimizers.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/python/estimator/canned/optimizers.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.012658 | 80 | 0.719904 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from tensorflow.python.training import adagrad
from tensorflow.python.training import adam
from tensorflow.python.training import ftrl
from tensorflow.python.training import gradient... | true | true |
f72c5d1dce32355c3989c67add71367d80276cc4 | 6,188 | py | Python | code/common/preprocessing.py | monperrus/iFixR | 5548f3ba91341dc9e73057269f8c01a0b1b6fc68 | [
"MIT"
] | 8 | 2019-07-23T15:03:50.000Z | 2021-02-08T11:06:53.000Z | code/common/preprocessing.py | monperrus/iFixR | 5548f3ba91341dc9e73057269f8c01a0b1b6fc68 | [
"MIT"
] | null | null | null | code/common/preprocessing.py | monperrus/iFixR | 5548f3ba91341dc9e73057269f8c01a0b1b6fc68 | [
"MIT"
] | 4 | 2019-09-19T08:23:46.000Z | 2021-03-05T13:57:40.000Z | from nltk.tokenize import RegexpTokenizer
# from stop_words import get_stop_words
from nltk.stem.porter import PorterStemmer
from string import punctuation
import re
from nltk.corpus import stopwords
en_stop = stopwords.words('english')
from nltk.corpus import wordnet
import html
from common.commons import *
CODE_PATH... | 26.672414 | 139 | 0.609082 | from nltk.tokenize import RegexpTokenizer
from nltk.stem.porter import PorterStemmer
from string import punctuation
import re
from nltk.corpus import stopwords
en_stop = stopwords.words('english')
from nltk.corpus import wordnet
import html
from common.commons import *
CODE_PATH = os.environ["CODE_PATH"]
import spac... | true | true |
f72c5d5b573a0a6f9bb62598300340bf644adab6 | 4,237 | py | Python | ControlFlowGenerator.py | mehrangoli/Control-Flow-Extractor | 6993be4b8508821674958e72b0d74159bc9a16a3 | [
"MIT"
] | 1 | 2019-07-18T08:06:51.000Z | 2019-07-18T08:06:51.000Z | ControlFlowGenerator.py | mehrangoli/Control-Flow-Extractor | 6993be4b8508821674958e72b0d74159bc9a16a3 | [
"MIT"
] | null | null | null | ControlFlowGenerator.py | mehrangoli/Control-Flow-Extractor | 6993be4b8508821674958e72b0d74159bc9a16a3 | [
"MIT"
] | null | null | null | #This is a parser to generate control flow of a SystemC design from its extracted run-time information by GDB and present it in XML or txt format.
#Copyright (c) 2019 Group of Computer Architecture, university of Bremen. All Rights Reserved.
#Filename: ControlFlowGenerator.py
#Version 1 09-July-2019
# -- coding: utf-8... | 36.525862 | 190 | 0.665093 |
import re
import copy
from Define import *
class CF_generator:
def __init__(self):
self.sequence_dict = {}
self.unic_seq_dic = {}
try:
self.gdb_log = open("gdblog_ctrl.txt",'r')
except IOError:
print info_user.FAIL + "Could not find \"gdblog_ctrl.txt\" file!" + info_user.ENDC
def CF_extractor... | false | true |
f72c5e0a7a2455dfd966067814f820b39b4646a1 | 8,806 | py | Python | src/main/resources/pytz/zoneinfo/America/Moncton.py | TheEin/swagger-maven-plugin | cf93dce2d5c8d3534f4cf8c612b11e2d2313871b | [
"Apache-2.0"
] | 65 | 2015-11-14T13:46:01.000Z | 2021-08-14T05:54:04.000Z | lib/pytz/zoneinfo/America/Moncton.py | tjsavage/polymer-dashboard | 19bc467f1206613f8eec646b6f2bc43cc319ef75 | [
"CNRI-Python",
"Linux-OpenIB"
] | 13 | 2016-03-31T20:00:17.000Z | 2021-08-20T14:52:31.000Z | lib/pytz/zoneinfo/America/Moncton.py | tjsavage/polymer-dashboard | 19bc467f1206613f8eec646b6f2bc43cc319ef75 | [
"CNRI-Python",
"Linux-OpenIB"
] | 20 | 2015-03-18T08:41:37.000Z | 2020-12-18T02:58:30.000Z | '''tzinfo timezone information for America/Moncton.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Moncton(DstTzInfo):
'''America/Moncton timezone definition. See datetime.tzinfo for details'''
zone = 'America/Moncton'
... | 20.337182 | 78 | 0.563479 | from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Moncton(DstTzInfo):
zone = 'America/Moncton'
_utc_transition_times = [
d(1,1,1,0,0,0),
d(1902,6,15,5,0,0),
d(1918,4,14,6,0,0),
d(1918,10,31,5,0,0),
d(1933,6,11,5,0,0),
d(1933,... | true | true |
f72c5ecb4c2bda8417b9edf7a53fca157ea84580 | 397 | py | Python | ReefberryPi/wsgi.py | reefberrypi/reefberrypi | f1e9977e8f56b402ef4d231ba8d4cdd0e469db42 | [
"MIT"
] | null | null | null | ReefberryPi/wsgi.py | reefberrypi/reefberrypi | f1e9977e8f56b402ef4d231ba8d4cdd0e469db42 | [
"MIT"
] | null | null | null | ReefberryPi/wsgi.py | reefberrypi/reefberrypi | f1e9977e8f56b402ef4d231ba8d4cdd0e469db42 | [
"MIT"
] | null | null | null | """
WSGI config for ReefberryPi project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ReefberryPi.settings")
from djang... | 26.466667 | 78 | 0.793451 |
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ReefberryPi.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| true | true |
f72c5ef7f4210f6058725bdb8a177f76f278f6d9 | 3,669 | py | Python | quetz/tests/test_workers.py | beenje/quetz | 1c9e5827e81f7ea89e7a0efc4c855ef63577a028 | [
"BSD-3-Clause"
] | null | null | null | quetz/tests/test_workers.py | beenje/quetz | 1c9e5827e81f7ea89e7a0efc4c855ef63577a028 | [
"BSD-3-Clause"
] | null | null | null | quetz/tests/test_workers.py | beenje/quetz | 1c9e5827e81f7ea89e7a0efc4c855ef63577a028 | [
"BSD-3-Clause"
] | null | null | null | import os
import socket
from contextlib import closing
import pytest
import requests
from fastapi import BackgroundTasks
from quetz.authorization import Rules
from quetz.dao import Dao
from quetz.db_models import User
from quetz.tasks.workers import RQManager, SubprocessWorker, ThreadingWorker
@pytest.fixture
def s... | 21.086207 | 87 | 0.696648 | import os
import socket
from contextlib import closing
import pytest
import requests
from fastapi import BackgroundTasks
from quetz.authorization import Rules
from quetz.dao import Dao
from quetz.db_models import User
from quetz.tasks.workers import RQManager, SubprocessWorker, ThreadingWorker
@pytest.fixture
def s... | true | true |
f72c5f1f4d6cd6f6582fcd1e96aee59135e0c5f7 | 14,438 | py | Python | grr/lib/lexer.py | nexus-lab/relf-server | d46774799c20376691c38f9293f454a3aff3ccb3 | [
"Apache-2.0"
] | null | null | null | grr/lib/lexer.py | nexus-lab/relf-server | d46774799c20376691c38f9293f454a3aff3ccb3 | [
"Apache-2.0"
] | null | null | null | grr/lib/lexer.py | nexus-lab/relf-server | d46774799c20376691c38f9293f454a3aff3ccb3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""An LL(1) lexer. This lexer is very tolerant of errors and can resync."""
import logging
import re
from grr.lib import utils
class Token(object):
"""A token action."""
state_regex = None
def __init__(self, state_regex, regex, actions, next_state, flags=re.I):
"""Constructor.
... | 28.991968 | 80 | 0.626333 |
import logging
import re
from grr.lib import utils
class Token(object):
state_regex = None
def __init__(self, state_regex, regex, actions, next_state, flags=re.I):
if state_regex:
self.state_regex = re.compile(state_regex, re.DOTALL | re.M | re.S | re.U
| flags... | true | true |
f72c5f21b10b223a9ba7876395cff13950f436cd | 5,375 | py | Python | hw2skeleton/k_means.py | egilbertson-ucsf/algHW2 | eec0f4e42e27d4c7633cc907d6f523285fadd79c | [
"Apache-2.0"
] | 1 | 2022-02-07T21:00:46.000Z | 2022-02-07T21:00:46.000Z | hw2skeleton/k_means.py | egilbertson-ucsf/algHW2 | eec0f4e42e27d4c7633cc907d6f523285fadd79c | [
"Apache-2.0"
] | null | null | null | hw2skeleton/k_means.py | egilbertson-ucsf/algHW2 | eec0f4e42e27d4c7633cc907d6f523285fadd79c | [
"Apache-2.0"
] | null | null | null | from hw2skeleton import cluster as cl
from hw2skeleton import io
import sklearn.metrics as sk
import os
import pandas as pd
import numpy as np
import math
aa3 = "ALA CYS ASP GLU PHE GLY HIS ILE LYS LEU MET ASN PRO GLN ARG SER THR VAL TRP TYR".split()
aa_df = pd.DataFrame(0, index=list(aa3), columns=['Count'])
def cal... | 31.25 | 101 | 0.661767 | from hw2skeleton import cluster as cl
from hw2skeleton import io
import sklearn.metrics as sk
import os
import pandas as pd
import numpy as np
import math
aa3 = "ALA CYS ASP GLU PHE GLY HIS ILE LYS LEU MET ASN PRO GLN ARG SER THR VAL TRP TYR".split()
aa_df = pd.DataFrame(0, index=list(aa3), columns=['Count'])
def cal... | true | true |
f72c5fd356bc70a6fedc8a393b6f0f7e3a5126db | 3,817 | py | Python | zester/client.py | Rahul09123/zester | e878ba5ce66156a642bc7513a69dc4175f9393be | [
"ISC"
] | 10 | 2015-10-17T16:12:30.000Z | 2021-12-09T04:08:47.000Z | zester/client.py | Rahul09123/zester | e878ba5ce66156a642bc7513a69dc4175f9393be | [
"ISC"
] | null | null | null | zester/client.py | Rahul09123/zester | e878ba5ce66156a642bc7513a69dc4175f9393be | [
"ISC"
] | 2 | 2020-05-05T04:04:28.000Z | 2020-09-30T14:19:16.000Z | from collections import namedtuple
import inspect
import os
from ghost import Ghost
class Client(object):
def __init__(self, url=None):
if url:
self.url = url
assert self.url, "All clients must have a URL attribute"
self._attributes = self._collect_attributes()
self._c... | 34.387387 | 78 | 0.637674 | from collections import namedtuple
import inspect
import os
from ghost import Ghost
class Client(object):
def __init__(self, url=None):
if url:
self.url = url
assert self.url, "All clients must have a URL attribute"
self._attributes = self._collect_attributes()
self._c... | true | true |
f72c603dfc8ecbd5f63c67e5d3ff1d9b9f2bae6b | 662 | py | Python | rotateMatrix90/rotMat90.py | lowylow/InterviewQuestions | e267a601ff336b0a2a581db4ae985283a29fed51 | [
"MIT"
] | null | null | null | rotateMatrix90/rotMat90.py | lowylow/InterviewQuestions | e267a601ff336b0a2a581db4ae985283a29fed51 | [
"MIT"
] | null | null | null | rotateMatrix90/rotMat90.py | lowylow/InterviewQuestions | e267a601ff336b0a2a581db4ae985283a29fed51 | [
"MIT"
] | null | null | null | def rotate90acw(matrix):
outMatrix = []
for x in range(len(matrix)):
outArray = []
for y in range(len(matrix)):
outArray.append(matrix[len(matrix)-1-y][len(matrix)-1-x])
outMatrix.append(outArray[::-1])
return outMatrix
def rotate90cw(matrix):
... | 23.642857 | 70 | 0.5 | def rotate90acw(matrix):
outMatrix = []
for x in range(len(matrix)):
outArray = []
for y in range(len(matrix)):
outArray.append(matrix[len(matrix)-1-y][len(matrix)-1-x])
outMatrix.append(outArray[::-1])
return outMatrix
def rotate90cw(matrix):
... | true | true |
f72c60682595bfbd3fa6b5191c70b2cc02dd5f4c | 36,930 | py | Python | tests/hwsim/test_owe.py | cschuber/hostap | b26f5c0fe35cd0472ea43f533b981ac2d91cdf1f | [
"Unlicense"
] | 21 | 2018-11-25T17:42:48.000Z | 2021-12-17T11:04:56.000Z | tests/hwsim/test_owe.py | cschuber/hostap | b26f5c0fe35cd0472ea43f533b981ac2d91cdf1f | [
"Unlicense"
] | 3 | 2017-08-11T16:48:19.000Z | 2020-03-10T21:18:17.000Z | tests/hwsim/test_owe.py | cschuber/hostap | b26f5c0fe35cd0472ea43f533b981ac2d91cdf1f | [
"Unlicense"
] | 18 | 2015-03-11T07:09:31.000Z | 2022-03-25T08:29:18.000Z | # Test cases for Opportunistic Wireless Encryption (OWE)
# Copyright (c) 2017, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import binascii
import logging
logger = logging.getLogger()
import time
import os
import struct
import hostapd
... | 38.710692 | 115 | 0.616951 |
import binascii
import logging
logger = logging.getLogger()
import time
import os
import struct
import hostapd
from wpasupplicant import WpaSupplicant
import hwsim_utils
from tshark import run_tshark
from utils import HwsimSkip, fail_test, alloc_fail, wait_fail_trigger
from test_ap_acs import wait_acs
def test_... | true | true |
f72c6125a11e0ae38fd3d3c079c6d6047cfb6b22 | 2,373 | py | Python | backend/alembic/env.py | jflad17/pilot_logbook | f75c9866d073c33d001ae2d0eb0994496eb49045 | [
"MIT"
] | 1 | 2022-03-25T23:41:37.000Z | 2022-03-25T23:41:37.000Z | backend/alembic/env.py | jflad17/pilot_logbook | f75c9866d073c33d001ae2d0eb0994496eb49045 | [
"MIT"
] | null | null | null | backend/alembic/env.py | jflad17/pilot_logbook | f75c9866d073c33d001ae2d0eb0994496eb49045 | [
"MIT"
] | null | null | null | from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from models import *
from db.base import Base
from core.config import settings
from alembic import context
from models import *
# this is the Alembic Config object, which provides
# access to the values within t... | 27.275862 | 74 | 0.714286 | from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from models import *
from db.base import Base
from core.config import settings
from alembic import context
from models import *
config = context.config
fileConfig(config.config_file_name)
# for 'autogener... | true | true |
f72c61450c801c44dc77e1b98289e540685b544a | 1,343 | py | Python | bootleg/embeddings/word_embeddings/base_word_emb.py | mleszczy/bootleg | 162d74001cdfbbe146753393641d549e0328acb1 | [
"Apache-2.0"
] | 1 | 2021-01-11T18:40:09.000Z | 2021-01-11T18:40:09.000Z | bootleg/embeddings/word_embeddings/base_word_emb.py | mleszczy/bootleg | 162d74001cdfbbe146753393641d549e0328acb1 | [
"Apache-2.0"
] | null | null | null | bootleg/embeddings/word_embeddings/base_word_emb.py | mleszczy/bootleg | 162d74001cdfbbe146753393641d549e0328acb1 | [
"Apache-2.0"
] | null | null | null | """Base word embedding"""
import torch
import torch.nn as nn
import os
from bootleg.utils import logging_utils
class BaseWordEmbedding(nn.Module):
"""
Base word embedding class. We split the word embedding from the sentence encoder, similar to BERT.
Attributes:
pad_id: id of the pad word index
... | 32.756098 | 138 | 0.684289 | import torch
import torch.nn as nn
import os
from bootleg.utils import logging_utils
class BaseWordEmbedding(nn.Module):
def __init__(self, args, main_args, word_symbols):
super(BaseWordEmbedding, self).__init__()
self.logger = logging_utils.get_logger(main_args)
self._key = "word"
... | true | true |
f72c63c7014f8654c874d4b6bc686d7d1259981c | 1,815 | py | Python | exampleapp/view1/views.py | thomasjiangcy/django-rest-mock | 09e91de20d1a5efd5c47c6e3d7fe979443012e2c | [
"MIT"
] | 9 | 2018-03-05T12:45:07.000Z | 2021-11-15T15:22:18.000Z | exampleapp/view1/views.py | thomasjiangcy/django-rest-mock | 09e91de20d1a5efd5c47c6e3d7fe979443012e2c | [
"MIT"
] | null | null | null | exampleapp/view1/views.py | thomasjiangcy/django-rest-mock | 09e91de20d1a5efd5c47c6e3d7fe979443012e2c | [
"MIT"
] | null | null | null | from rest_framework import generics, views
from rest_framework.response import Response
class SomeView(views.APIView):
"""
URL: /api/someview
"""
def get(self, request, *args, **kwargs):
"""
```
{
"success": "Hello, world!"
}
```
"""
... | 21.86747 | 84 | 0.406061 | from rest_framework import generics, views
from rest_framework.response import Response
class SomeView(views.APIView):
def get(self, request, *args, **kwargs):
pass
class ResourceListView(generics.ListCreateAPIView):
def post(self, request, *args, **kwargs):
pass
class ResourceView(gener... | true | true |
f72c64df1da4e00b9d299b8a5608883b2530e2c8 | 7,812 | py | Python | scons/scons-local-4.1.0/SCons/Tool/mingw.py | vishalbelsare/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | [
"BSD-2-Clause"
] | null | null | null | scons/scons-local-4.1.0/SCons/Tool/mingw.py | vishalbelsare/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | [
"BSD-2-Clause"
] | null | null | null | scons/scons-local-4.1.0/SCons/Tool/mingw.py | vishalbelsare/Soar | a1c5e249499137a27da60533c72969eef3b8ab6b | [
"BSD-2-Clause"
] | null | null | null | # MIT License
#
# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, ... | 36.166667 | 110 | 0.670123 |
import os
import os.path
import glob
import SCons.Action
import SCons.Builder
import SCons.Defaults
import SCons.Tool
import SCons.Util
mingw_paths = [
r'c:\MinGW\bin',
r'C:\cygwin64\bin',
r'C:\msys64',
r'C:\msys64\mingw64\bin',
r'C:\cygwin\bin',
r'C:\msys',
r'C:\Pr... | true | true |
f72c66e743146c7a5b70a5440e9ab5459f10245b | 6,426 | py | Python | Lib/site-packages/pyparsing/actions.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2020-10-05T05:38:26.000Z | 2020-10-05T05:38:26.000Z | Lib/site-packages/pyparsing/actions.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/pyparsing/actions.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | # actions.py
from .exceptions import ParseException
from .util import col
class OnlyOnce:
"""
Wrapper for parse actions, to ensure they are only called once.
"""
def __init__(self, method_call):
from .core import _trim_arity
self.callable = _trim_arity(method_call)
self.call... | 30.894231 | 122 | 0.613601 |
from .exceptions import ParseException
from .util import col
class OnlyOnce:
def __init__(self, method_call):
from .core import _trim_arity
self.callable = _trim_arity(method_call)
self.called = False
def __call__(self, s, l, t):
if not self.called:
results = s... | true | true |
f72c67eadf3af59757f3c3b77056d4d8ab1bc14b | 2,242 | py | Python | py/game_logic/GameList.py | rSimulate/Cosmosium | f2489862b9b747458a6be9b884c9de75bd6eb3d2 | [
"CC-BY-4.0"
] | 18 | 2015-01-02T05:22:43.000Z | 2021-11-12T12:11:12.000Z | py/game_logic/GameList.py | rSimulate/Cosmosium | f2489862b9b747458a6be9b884c9de75bd6eb3d2 | [
"CC-BY-4.0"
] | 3 | 2015-07-14T19:11:54.000Z | 2018-09-17T19:09:52.000Z | py/game_logic/GameList.py | rSimulate/Cosmosium | f2489862b9b747458a6be9b884c9de75bd6eb3d2 | [
"CC-BY-4.0"
] | 4 | 2016-02-24T05:19:07.000Z | 2022-02-15T17:36:37.000Z | import pickle
from py.game_logic.Game import Game
GAMES_FILE = 'db/GAMELIST.pickle'
class GameList(object):
def __init__(self):
self.games = [Game()]
def __len__(self):
return len(self.games)
def addGame(self):
self.games.append(Game())
# this turned... | 32.492754 | 99 | 0.566012 | import pickle
from py.game_logic.Game import Game
GAMES_FILE = 'db/GAMELIST.pickle'
class GameList(object):
def __init__(self):
self.games = [Game()]
def __len__(self):
return len(self.games)
def addGame(self):
self.games.append(Game())
... | false | true |
f72c68b5184364eaf2b32e9631fcdb1b88247b70 | 702 | py | Python | setup.py | luk036/ellpy | 07fe4377a18ae9b38be9ad34eceb701f26873607 | [
"MIT"
] | 7 | 2019-01-01T00:30:03.000Z | 2021-07-11T12:54:46.000Z | setup.py | luk036/ellpy | 07fe4377a18ae9b38be9ad34eceb701f26873607 | [
"MIT"
] | 1 | 2018-06-03T09:01:26.000Z | 2018-06-03T09:01:26.000Z | setup.py | luk036/ellpy | 07fe4377a18ae9b38be9ad34eceb701f26873607 | [
"MIT"
] | 1 | 2018-06-03T08:59:05.000Z | 2018-06-03T08:59:05.000Z | """
Setup file for ellpy.
Use setup.cfg to configure your project.
This file was generated with PyScaffold 4.0.2.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""
from setuptools import setup
if __name__ == "__main__":
try:
... | 31.909091 | 77 | 0.638177 | from setuptools import setup
if __name__ == "__main__":
try:
setup(use_scm_version={"version_scheme": "no-guess-dev"})
except:
print(
"\n\nAn error occurred while building the project, "
"please ensure you have the most updated version of setuptools, "
"set... | true | true |
f72c692cf8cf1539d1b99caf1dd1a442c8da420c | 7,899 | py | Python | lib/modeling/keypoint_rcnn_heads.py | skokec/detectron-villard | 9e420bf3fb75a8f06f6e3fd970fc2600d8969d10 | [
"Apache-2.0"
] | 287 | 2018-12-23T08:31:09.000Z | 2022-02-27T14:52:21.000Z | lib/modeling/keypoint_rcnn_heads.py | absorbguo/Detectron | 2f8161edc3092b0382cab535c977a180a8b3cc4d | [
"Apache-2.0"
] | 54 | 2018-12-26T13:04:32.000Z | 2020-04-24T04:09:30.000Z | lib/modeling/keypoint_rcnn_heads.py | absorbguo/Detectron | 2f8161edc3092b0382cab535c977a180a8b3cc4d | [
"Apache-2.0"
] | 96 | 2018-12-24T05:12:36.000Z | 2021-04-23T15:51:21.000Z | # Copyright (c) 2017-present, Facebook, 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 agreed... | 36.233945 | 80 | 0.617547 |
model, blob_in, dim_in, spatial_scale
):
model.RoIFeatureTransform(
blob_in,
'_[pose]_pool5',
blob_rois='keypoint_rois',
method=cfg.KRCNN.ROI_XFORM_METHOD,
resolution=cfg.KRCNN.ROI_XFORM_RESOLUTION,
sampling_ratio=cfg.KRCNN.ROI_XFORM_SAMPLING_RATIO,
... | true | true |
f72c69bd895eea56254b314d4418757ffc5e1cbe | 1,266 | py | Python | Scripts/Legacy/line1prep.py | rhong3/CPTAC-UCEC | ec83fbee234b5ad3df6524cdd960b5f0f3da9ea9 | [
"MIT"
] | 4 | 2019-01-04T21:11:03.000Z | 2020-12-11T16:56:15.000Z | Scripts/Legacy/line1prep.py | rhong3/CPTAC-UCEC | ec83fbee234b5ad3df6524cdd960b5f0f3da9ea9 | [
"MIT"
] | null | null | null | Scripts/Legacy/line1prep.py | rhong3/CPTAC-UCEC | ec83fbee234b5ad3df6524cdd960b5f0f3da9ea9 | [
"MIT"
] | null | null | null | import pandas as pd
labels = pd.read_csv('../Fusion_dummy_His_MUT_joined.csv', header=0)
# line = pd.read_csv('../../Line1.csv', header=0)
line = pd.read_csv('../EC_cyclin_expression.csv', header=0)
# line['name'] = line['Proteomics_Participant_ID']
# line = line.drop(['Proteomics_Participant_ID', 'Histologic_type', ... | 48.692308 | 109 | 0.671406 | import pandas as pd
labels = pd.read_csv('../Fusion_dummy_His_MUT_joined.csv', header=0)
line = pd.read_csv('../EC_cyclin_expression.csv', header=0)
line['name'] = line['Sample_ID'].str.slice(start=0, stop=9)
line = line.drop(['Sample_ID', 'Genomic_subtype'], axis=1)
labels = labels.join(line.set_index('na... | true | true |
f72c6a4e0c25397651cfa6ffd566d94b400550f8 | 87,446 | py | Python | Lib/zipfile.py | fochoao/CPython | c92e0770af558fe3e440e44d3605c3acaf3c5b68 | [
"TCL",
"0BSD"
] | null | null | null | Lib/zipfile.py | fochoao/CPython | c92e0770af558fe3e440e44d3605c3acaf3c5b68 | [
"TCL",
"0BSD"
] | null | null | null | Lib/zipfile.py | fochoao/CPython | c92e0770af558fe3e440e44d3605c3acaf3c5b68 | [
"TCL",
"0BSD"
] | null | null | null | """
Read and write ZIP files.
XXX references to utf-8 need further investigation.
"""
import binascii
import importlib.util
import io
import itertools
import os
import posixpath
import shutil
import stat
import struct
import sys
import threading
import time
import contextlib
try:
import zlib # We may need its com... | 35.897373 | 102 | 0.569471 | import binascii
import importlib.util
import io
import itertools
import os
import posixpath
import shutil
import stat
import struct
import sys
import threading
import time
import contextlib
try:
import zlib
crc32 = zlib.crc32
except ImportError:
zlib = None
crc32 = binascii.crc32
try:
import bz2 ... | true | true |
f72c6a59206b96eb9586897deebd2a857da10ff7 | 2,944 | py | Python | Demo/sgi/video/Vreceive.py | AtjonTV/Python-1.4 | 2a80562c5a163490f444181cb75ca1b3089759ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | Demo/sgi/video/Vreceive.py | AtjonTV/Python-1.4 | 2a80562c5a163490f444181cb75ca1b3089759ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | Demo/sgi/video/Vreceive.py | AtjonTV/Python-1.4 | 2a80562c5a163490f444181cb75ca1b3089759ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | #!/ufs/guido/bin/sgi/python
# Receive live video UDP packets.
# Usage: Vreceive [port]
import sys
import struct
from socket import * # syscalls and support functions
from SOCKET import * # <sys/socket.h>
from IN import * # <netinet/in.h>
import select
import struct
import gl, GL, DEVICE
sys.path.append('/ufs/gu... | 21.647059 | 68 | 0.66712 |
import sys
import struct
from socket import *
from SOCKET import *
from IN import *
import select
import struct
import gl, GL, DEVICE
sys.path.append('/ufs/guido/src/video')
import LiveVideoOut
import regsub
import getopt
from senddefs import *
def usage(msg):
print msg
print 'usage: Vreceive [-m m... | false | true |
f72c6a5b0a88709c33bc15b7b8f421bdb28239fe | 806 | py | Python | Scripts/bulk_image_download.py | POSCON-United-Kingdom/UK-Radar-Data | 6a020b03fbfeffe9f7eb53e4b4559de48134e351 | [
"Apache-2.0"
] | 2 | 2022-01-15T14:01:36.000Z | 2022-01-15T22:54:40.000Z | Scripts/bulk_image_download.py | POSCON-United-Kingdom/UK-Radar-Data | 6a020b03fbfeffe9f7eb53e4b4559de48134e351 | [
"Apache-2.0"
] | null | null | null | Scripts/bulk_image_download.py | POSCON-United-Kingdom/UK-Radar-Data | 6a020b03fbfeffe9f7eb53e4b4559de48134e351 | [
"Apache-2.0"
] | null | null | null | import re
import requests
import urllib.request
import urllib3
from bs4 import BeautifulSoup
print('Beginning file download with urllib2...')
url = "https://www.aurora.nats.co.uk/htmlAIP/Publications/2020-04-09/html/eSUP/EG-eSUP-2020-017-en-GB.html"
"""Parse the given table into a beautifulsoup object"""
count = 0
ht... | 29.851852 | 107 | 0.69727 | import re
import requests
import urllib.request
import urllib3
from bs4 import BeautifulSoup
print('Beginning file download with urllib2...')
url = "https://www.aurora.nats.co.uk/htmlAIP/Publications/2020-04-09/html/eSUP/EG-eSUP-2020-017-en-GB.html"
count = 0
http = urllib3.PoolManager()
error = http.request("GET", u... | true | true |
f72c6be17e996073ee98833c5d3263506ac82ca5 | 987 | py | Python | test/unit/sorting/test_wordle_solver.py | bestpersonyes2/algorithms | 4225b3ebcdcbd29c80abe0b086d986875526dfcc | [
"MIT"
] | null | null | null | test/unit/sorting/test_wordle_solver.py | bestpersonyes2/algorithms | 4225b3ebcdcbd29c80abe0b086d986875526dfcc | [
"MIT"
] | null | null | null | test/unit/sorting/test_wordle_solver.py | bestpersonyes2/algorithms | 4225b3ebcdcbd29c80abe0b086d986875526dfcc | [
"MIT"
] | null | null | null | import os
from algorithms.sorting.wordle_solver import _read_file, get_best_guess, get_most_common
def test_get_most_common():
file_data = _read_file(os.path.join('algorithms', 'assets', 'wordle_answer_list.json'))
most_common_start, most_common_letters, possible_words = get_most_common(file_data)
asser... | 32.9 | 98 | 0.749747 | import os
from algorithms.sorting.wordle_solver import _read_file, get_best_guess, get_most_common
def test_get_most_common():
file_data = _read_file(os.path.join('algorithms', 'assets', 'wordle_answer_list.json'))
most_common_start, most_common_letters, possible_words = get_most_common(file_data)
asser... | true | true |
f72c6c14815e59ace61d84641f721f81f31b67ac | 8,156 | py | Python | sentence_transformers/datasets/SentenceLabelDataset.py | dd-dos/sentence-transformers | 8f9c36b788e15141f723d80fea67ed16785cd18e | [
"Apache-2.0"
] | 31 | 2021-04-06T16:20:30.000Z | 2022-02-16T08:29:24.000Z | sentence_transformers/datasets/SentenceLabelDataset.py | dd-dos/sentence-transformers | 8f9c36b788e15141f723d80fea67ed16785cd18e | [
"Apache-2.0"
] | 5 | 2021-07-02T04:37:04.000Z | 2021-07-21T00:02:58.000Z | sentence_transformers/datasets/SentenceLabelDataset.py | dd-dos/sentence-transformers | 8f9c36b788e15141f723d80fea67ed16785cd18e | [
"Apache-2.0"
] | 5 | 2021-04-07T08:35:06.000Z | 2022-03-08T08:33:05.000Z | from torch.utils.data import Dataset
from typing import List
import bisect
import torch
import logging
import numpy as np
from tqdm import tqdm
from .. import SentenceTransformer
from ..readers.InputExample import InputExample
from multiprocessing import Pool, cpu_count
import multiprocessing
class SentenceLabelDatase... | 44.086486 | 161 | 0.676067 | from torch.utils.data import Dataset
from typing import List
import bisect
import torch
import logging
import numpy as np
from tqdm import tqdm
from .. import SentenceTransformer
from ..readers.InputExample import InputExample
from multiprocessing import Pool, cpu_count
import multiprocessing
class SentenceLabelDatase... | true | true |
f72c6c43bcf8f2dbd66c55523b66a5c428917e0a | 3,129 | py | Python | Set3/The CBC padding oracle/padding_oracle.py | BadMonkey7/Cryptopals | 53bbef43d0d0dc62286514122c2651b1ce8e7471 | [
"MIT"
] | 1 | 2021-05-07T16:35:24.000Z | 2021-05-07T16:35:24.000Z | Set3/The CBC padding oracle/padding_oracle.py | BadMonkey7/Cryptopals | 53bbef43d0d0dc62286514122c2651b1ce8e7471 | [
"MIT"
] | null | null | null | Set3/The CBC padding oracle/padding_oracle.py | BadMonkey7/Cryptopals | 53bbef43d0d0dc62286514122c2651b1ce8e7471 | [
"MIT"
] | null | null | null | # coding=utf-8
from random import randint
import os
from Crypto.Cipher import AES
from base64 import b64decode
all = [
"MDAwMDAwTm93IHRoYXQgdGhlIHBhcnR5IGlzIGp1bXBpbmc=",
"MDAwMDAxV2l0aCB0aGUgYmFzcyBraWNrZWQgaW4gYW5kIHRoZSBWZWdhJ3MgYXJlIHB1bXBpbic=",
"MDAwMDAyUXVpY2sgdG8gdGhlIHBvaW50LCB0byB0aGUgcG9pbnQsIG5vIGZha2luZw==... | 28.972222 | 116 | 0.590284 |
from random import randint
import os
from Crypto.Cipher import AES
from base64 import b64decode
all = [
"MDAwMDAwTm93IHRoYXQgdGhlIHBhcnR5IGlzIGp1bXBpbmc=",
"MDAwMDAxV2l0aCB0aGUgYmFzcyBraWNrZWQgaW4gYW5kIHRoZSBWZWdhJ3MgYXJlIHB1bXBpbic=",
"MDAwMDAyUXVpY2sgdG8gdGhlIHBvaW50LCB0byB0aGUgcG9pbnQsIG5vIGZha2luZw==",
"MDAwMDAzQ2... | false | true |
f72c6cbe53ce184511d53967dee75da42ddc4cbb | 11,828 | py | Python | main_multi.py | erfanMhi/Cooperative-Coevolution-Transfer-Optimization | e75b7930bd8b55a160668b1039ac154a0d0270d7 | [
"MIT"
] | 3 | 2019-08-04T18:37:58.000Z | 2020-08-16T13:01:40.000Z | main_multi.py | erfanMhi/Cooperative-Coevolution-Transfer-Optimization | e75b7930bd8b55a160668b1039ac154a0d0270d7 | [
"MIT"
] | null | null | null | main_multi.py | erfanMhi/Cooperative-Coevolution-Transfer-Optimization | e75b7930bd8b55a160668b1039ac154a0d0270d7 | [
"MIT"
] | null | null | null |
import argparse
import os
import queue
import multiprocessing as mp
# import SharedArray as sa
import numpy as np
from copy import deepcopy
from time import time
from pprint import pprint
from utils.data_manipulators import *
from evolution.operators import *
from to.probabilistic_model import ProbabilisticModel
fr... | 34.086455 | 179 | 0.633581 |
import argparse
import os
import queue
import multiprocessing as mp
import numpy as np
from copy import deepcopy
from time import time
from pprint import pprint
from utils.data_manipulators import *
from evolution.operators import *
from to.probabilistic_model import ProbabilisticModel
from to.mixture_model import... | true | true |
f72c6d1c6f29288f9f93496e8adfb3d17d94900b | 291 | py | Python | orb_simulator/other_language/testing_ast/Div.py | dmguezjaviersnet/IA-Sim-Comp-Project | 8165b9546efc45f98091a3774e2dae4f45942048 | [
"MIT"
] | 1 | 2022-01-19T22:49:09.000Z | 2022-01-19T22:49:09.000Z | orb_simulator/other_language/testing_ast/Div.py | dmguezjaviersnet/IA-Sim-Comp-Project | 8165b9546efc45f98091a3774e2dae4f45942048 | [
"MIT"
] | 15 | 2021-11-10T14:25:02.000Z | 2022-02-12T19:17:11.000Z | orb_simulator/other_language/testing_ast/Div.py | dmguezjaviersnet/IA-Sim-Comp-Project | 8165b9546efc45f98091a3774e2dae4f45942048 | [
"MIT"
] | null | null | null | from other_language.testing_ast.BinaryExpression import *
class Div(BinaryExpression):
def __init__(self, left: Expression, right: Expression):
super().__init__(left, right)
def eval(self):
self.left.eval() // self.right.eval()
| 19.4 | 60 | 0.608247 | from other_language.testing_ast.BinaryExpression import *
class Div(BinaryExpression):
def __init__(self, left: Expression, right: Expression):
super().__init__(left, right)
def eval(self):
self.left.eval() // self.right.eval()
| true | true |
f72c6dc05c0249cca7efdc46371d16e808b21190 | 7,782 | py | Python | tests/dataset.py | Juan0001/yellowbrick-docs-zh | 36275d9704fc2a946c5bec5f802106bb5281efd1 | [
"Apache-2.0"
] | 20 | 2018-03-24T02:29:20.000Z | 2022-03-03T05:01:40.000Z | tests/dataset.py | Juan0001/yellowbrick-docs-zh | 36275d9704fc2a946c5bec5f802106bb5281efd1 | [
"Apache-2.0"
] | 4 | 2018-03-20T12:01:17.000Z | 2019-04-07T16:02:19.000Z | tests/dataset.py | Juan0001/yellowbrick-docs-zh | 36275d9704fc2a946c5bec5f802106bb5281efd1 | [
"Apache-2.0"
] | 5 | 2018-03-17T08:18:57.000Z | 2019-11-15T02:20:20.000Z | # tests.dataset
# Helper functions for tests that utilize downloadable datasets.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Thu Oct 13 19:55:53 2016 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: dataset.py [8f4de77] benjamin@bengfort... | 34.741071 | 88 | 0.585582 | true | true | |
f72c6f6d29ba313be7a1401cddf2903254a2b3ac | 1,192 | py | Python | tweets/views.py | hariharaselvam/djangotraining | 77722b9bae1487b2b39c20db216d3edd46eddffb | [
"Apache-2.0"
] | null | null | null | tweets/views.py | hariharaselvam/djangotraining | 77722b9bae1487b2b39c20db216d3edd46eddffb | [
"Apache-2.0"
] | null | null | null | tweets/views.py | hariharaselvam/djangotraining | 77722b9bae1487b2b39c20db216d3edd46eddffb | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.views import View
from .forms import TwitterForm
from .models import *
from .tasks import get_tweets
#from twython import Twython
# Create your views here.
def twitter_view(request):
if request.method == 'GET':
form = Tw... | 22.490566 | 58 | 0.707215 | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.views import View
from .forms import TwitterForm
from .models import *
from .tasks import get_tweets
def twitter_view(request):
if request.method == 'GET':
form = TwitterForm()
return render(
request,
'tweets.... | false | true |
f72c705b69032d729b976d015ba6742b4d314c78 | 17,180 | py | Python | src/olympia/files/tests/test_file_viewer.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | null | null | null | src/olympia/files/tests/test_file_viewer.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | null | null | null | src/olympia/files/tests/test_file_viewer.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import mimetypes
import os
import shutil
import zipfile
from django import forms
from django.conf import settings
from django.core.cache import cache
from django.core.files.storage import default_storage as storage
import pytest
from freezegun import freeze_time
from unittest.mock import Mock... | 35.349794 | 79 | 0.626659 |
import mimetypes
import os
import shutil
import zipfile
from django import forms
from django.conf import settings
from django.core.cache import cache
from django.core.files.storage import default_storage as storage
import pytest
from freezegun import freeze_time
from unittest.mock import Mock, patch
from olympia i... | true | true |
f72c7105b40a75a34bc96103e54bc62ef812eb03 | 4,785 | py | Python | rapvis/rapvis_process.py | liuwell/rapvis | a69d06a31b1d7fe4510c1c90bfeee22b68a9b3b9 | [
"MIT"
] | 1 | 2020-10-25T10:23:45.000Z | 2020-10-25T10:23:45.000Z | rapvis/rapvis_process.py | liuwell/rapvis | a69d06a31b1d7fe4510c1c90bfeee22b68a9b3b9 | [
"MIT"
] | null | null | null | rapvis/rapvis_process.py | liuwell/rapvis | a69d06a31b1d7fe4510c1c90bfeee22b68a9b3b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import glob
import argparse
import numpy as np
import subprocess
import os
import time
import sys
#from rapvis_merge import merge_profiles, merge_gene_counts
#from rapvis_gene_dis import gene_dis
#from rapvis_quality import rRNAratio
from rapvis_general import current_time
import rapvis_rRNA
d... | 47.376238 | 366 | 0.708255 |
import glob
import argparse
import numpy as np
import subprocess
import os
import time
import sys
from rapvis_general import current_time
import rapvis_rRNA
def process2(R1, R2, output, adapter, threads, libpath, mapper, minlen, trim5, counts, rRNA):
file_name = R1.split("/")[-1].split("_")[0]
outdir = os.pat... | true | true |
f72c731f3e730de450ee248c0486bff1226a032a | 322 | py | Python | bin/gen-nfs-fstab.py | french-tries/auto-distro | bd2fccd7862f97b0f91e742b3c53af045b0a4475 | [
"MIT"
] | null | null | null | bin/gen-nfs-fstab.py | french-tries/auto-distro | bd2fccd7862f97b0f91e742b3c53af045b0a4475 | [
"MIT"
] | null | null | null | bin/gen-nfs-fstab.py | french-tries/auto-distro | bd2fccd7862f97b0f91e742b3c53af045b0a4475 | [
"MIT"
] | null | null | null | import os
import configuration
output = '/etc/fstab'
with open(output, mode='a') as fstab:
fstab.write('\n\n')
for entry in configuration.nfs_entries:
os.makedirs(entry[1], exist_ok=True)
fstab.write(entry[0].ljust(50) + entry[1].ljust(40) + 'nfs'.ljust(10) + 'noauto'.ljust(30) + '0 0\n')
... | 24.769231 | 109 | 0.630435 | import os
import configuration
output = '/etc/fstab'
with open(output, mode='a') as fstab:
fstab.write('\n\n')
for entry in configuration.nfs_entries:
os.makedirs(entry[1], exist_ok=True)
fstab.write(entry[0].ljust(50) + entry[1].ljust(40) + 'nfs'.ljust(10) + 'noauto'.ljust(30) + '0 0\n')
... | true | true |
f72c73488e94790062a1acf9156e490fc7770946 | 7,753 | py | Python | sdk/python/pulumi_azure_native/datalakeanalytics/compute_policy.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datalakeanalytics/compute_policy.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/datalakeanalytics/compute_policy.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 47.564417 | 601 | 0.665549 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ._enums import *
__all__ = ['ComputePolicy']
class ComputePolicy(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
... | true | true |
f72c7352f5956d525aae8e8f597fdae21fe13578 | 547 | py | Python | examples/get_server_info.py | edvinerikson/frostbite-rcon-utils | 089e1a59b7fcd72b8d8d3153fb396cfd8d4869f3 | [
"MIT"
] | 7 | 2016-10-10T08:21:15.000Z | 2022-03-12T23:45:24.000Z | examples/get_server_info.py | EdvinErikson/frostbite-rcon-utils | 089e1a59b7fcd72b8d8d3153fb396cfd8d4869f3 | [
"MIT"
] | 2 | 2016-02-18T16:11:48.000Z | 2016-02-18T17:24:14.000Z | examples/get_server_info.py | EdvinErikson/frostbite-rcon-utils | 089e1a59b7fcd72b8d8d3153fb396cfd8d4869f3 | [
"MIT"
] | 2 | 2016-02-17T22:14:47.000Z | 2016-08-13T01:52:32.000Z | import socket
from frostbite_rcon_utils import create_packet, encode_packet, decode_packet, contains_complete_packet
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.settimeout(1)
connection.connect(('188.126.64.4', 47215))
connection.setblocking(1)
packet_to_send = encode_packet(create_pac... | 30.388889 | 102 | 0.8117 | import socket
from frostbite_rcon_utils import create_packet, encode_packet, decode_packet, contains_complete_packet
connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.settimeout(1)
connection.connect(('188.126.64.4', 47215))
connection.setblocking(1)
packet_to_send = encode_packet(create_pac... | true | true |
f72c73592fff23ee5fe753971e6446fe835d7fc5 | 1,158 | py | Python | sympy/strategies/branch/tests/test_traverse.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 1 | 2016-02-22T22:46:50.000Z | 2016-02-22T22:46:50.000Z | sympy/strategies/branch/tests/test_traverse.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 7 | 2017-05-01T14:15:32.000Z | 2017-09-06T20:44:24.000Z | sympy/strategies/branch/tests/test_traverse.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 1 | 2020-09-09T15:20:27.000Z | 2020-09-09T15:20:27.000Z | from sympy import Basic
from sympy.strategies.branch.traverse import top_down, sall
from sympy.strategies.branch.core import do_one, identity
def inc(x):
if isinstance(x, int):
yield x + 1
def test_top_down_easy():
expr = Basic(1, 2)
expected = Basic(2, 3)
brl = top_down(inc)
assert s... | 24.638298 | 66 | 0.58981 | from sympy import Basic
from sympy.strategies.branch.traverse import top_down, sall
from sympy.strategies.branch.core import do_one, identity
def inc(x):
if isinstance(x, int):
yield x + 1
def test_top_down_easy():
expr = Basic(1, 2)
expected = Basic(2, 3)
brl = top_down(inc)
assert s... | true | true |
f72c73b22f0837188e5fc58d0e9f23032e5dba90 | 2,695 | py | Python | data/p4VQE/R4/benchmark/startQiskit_QC277.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_QC277.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_QC277.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=15
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... | 28.072917 | 118 | 0.636735 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.tes... | true | true |
f72c757fb6a92103d778c73856fcee6786544a37 | 6,342 | py | Python | test/test_conventions.py | takluyver/xray | 80c30ae343a2171c541da0387fed3926004030a7 | [
"Apache-2.0"
] | null | null | null | test/test_conventions.py | takluyver/xray | 80c30ae343a2171c541da0387fed3926004030a7 | [
"Apache-2.0"
] | null | null | null | test/test_conventions.py | takluyver/xray | 80c30ae343a2171c541da0387fed3926004030a7 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from datetime import datetime
import warnings
from xray import conventions
from . import TestCase, requires_netCDF4
class TestMaskedAndScaledArray(TestCase):
def test(self):
x = conventions.MaskedAndScaledArray(np.arange(3), fill_value=0)
self.assertEqual(x.... | 46.291971 | 88 | 0.564018 | import numpy as np
import pandas as pd
from datetime import datetime
import warnings
from xray import conventions
from . import TestCase, requires_netCDF4
class TestMaskedAndScaledArray(TestCase):
def test(self):
x = conventions.MaskedAndScaledArray(np.arange(3), fill_value=0)
self.assertEqual(x.... | true | true |
f72c7674672d02999eb1ca6e63915c7fe5ac8ab5 | 57 | py | Python | Exp2/Strategy/StrategyManager.py | inventivejon/INPROLA-Python | 8aab11a868b37a64c46e6287bf358b5b05673a28 | [
"Apache-2.0"
] | null | null | null | Exp2/Strategy/StrategyManager.py | inventivejon/INPROLA-Python | 8aab11a868b37a64c46e6287bf358b5b05673a28 | [
"Apache-2.0"
] | null | null | null | Exp2/Strategy/StrategyManager.py | inventivejon/INPROLA-Python | 8aab11a868b37a64c46e6287bf358b5b05673a28 | [
"Apache-2.0"
] | null | null | null | class StrategyManager():
def __init__():
pass | 19 | 24 | 0.614035 | class StrategyManager():
def __init__():
pass | true | true |
f72c7888070e1278b4c5a0b55319ce31c0795378 | 23,442 | py | Python | SprityBird/spritybird/python3.5/lib/python3.5/site-packages/sympy/printing/octave.py | MobileAnalytics/iPython-Framework | da0e598308c067cd5c5290a6364b3ffaf2d2418f | [
"MIT"
] | 4 | 2018-07-04T17:20:12.000Z | 2019-07-14T18:07:25.000Z | SprityBird/spritybird/python3.5/lib/python3.5/site-packages/sympy/printing/octave.py | MobileAnalytics/iPython-Framework | da0e598308c067cd5c5290a6364b3ffaf2d2418f | [
"MIT"
] | null | null | null | SprityBird/spritybird/python3.5/lib/python3.5/site-packages/sympy/printing/octave.py | MobileAnalytics/iPython-Framework | da0e598308c067cd5c5290a6364b3ffaf2d2418f | [
"MIT"
] | 1 | 2018-09-03T03:02:06.000Z | 2018-09-03T03:02:06.000Z | """
Octave (and Matlab) code printer
The `OctaveCodePrinter` converts SymPy expressions into Octave expressions.
It uses a subset of the Octave language for Matlab compatibility.
A complete code generator, which uses `octave_code` extensively, can be found
in `sympy.utilities.codegen`. The `codegen` module can be us... | 35.789313 | 80 | 0.569533 |
from __future__ import print_function, division
from sympy.core import Mul, Pow, S, Rational
from sympy.core.compatibility import string_types, range
from sympy.core.mul import _keep_coeff
from sympy.codegen.ast import Assignment
from sympy.printing.codeprinter import CodePrinter
from sympy.printing.precedence import ... | true | true |
f72c79f3f9a9af03ac560d30164899d30e36c861 | 692 | py | Python | src/examples/animations/AnimationGif.py | Gabvaztor/tensorflowCode | e206ea4544552b87c2d43274cea3182f6b385a87 | [
"Apache-2.0"
] | 4 | 2019-12-14T08:06:18.000Z | 2020-09-12T10:09:31.000Z | src/examples/animations/AnimationGif.py | Gabvaztor/tensorflowCode | e206ea4544552b87c2d43274cea3182f6b385a87 | [
"Apache-2.0"
] | null | null | null | src/examples/animations/AnimationGif.py | Gabvaztor/tensorflowCode | e206ea4544552b87c2d43274cea3182f6b385a87 | [
"Apache-2.0"
] | 2 | 2020-09-12T10:10:07.000Z | 2021-09-15T11:58:37.000Z | #IMPORTAMOS LIBRERIAS.
import numpy as np
import matplotlib.pyplot as plt
import animatplot as amp
#INTRODUCIMOS DATOS.
x = np.linspace(0, 1, 50)
t = np.linspace(0, 1, 20)
X, T = np.meshgrid(x, t)
Y = np.zeros(int(51*(X+T)))
#CREAMOS OBJETO "timeline".
timeline = amp.Timeline(t, units='s', fps=60)
#GENERAMOS ANIMA... | 20.352941 | 67 | 0.710983 |
import numpy as np
import matplotlib.pyplot as plt
import animatplot as amp
x = np.linspace(0, 1, 50)
t = np.linspace(0, 1, 20)
X, T = np.meshgrid(x, t)
Y = np.zeros(int(51*(X+T)))
timeline = amp.Timeline(t, units='s', fps=60)
block = amp.blocks.Line(X, Y, marker=".", linestyle="-", color="r")
anim = amp.Anima... | true | true |
f72c7b00779b23f24e5f6b86d0f4c382d11780f4 | 4,931 | py | Python | sdks/python/apache_beam/runners/worker/log_handler.py | dxichen/beam | d02b859cb37e3c9f565785e93384905f1078b409 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2018-12-08T05:19:04.000Z | 2018-12-08T05:19:07.000Z | sdks/python/apache_beam/runners/worker/log_handler.py | dxichen/beam | d02b859cb37e3c9f565785e93384905f1078b409 | [
"Apache-2.0",
"BSD-3-Clause"
] | 10 | 2016-03-21T22:50:43.000Z | 2016-07-12T16:59:21.000Z | sdks/python/apache_beam/runners/worker/log_handler.py | swegner/incubator-beam | 5466ac0b8819625b1d0ada3577c1fc103797f9a2 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2018-11-23T11:49:03.000Z | 2018-11-23T11:49:03.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 35.47482 | 80 | 0.724599 |
from __future__ import absolute_import
from __future__ import print_function
import logging
import math
import queue
import sys
import threading
from builtins import range
import grpc
from apache_beam.portability.api import beam_fn_api_pb2
from apache_beam.portability.api import beam_fn_api_pb2_grpc... | true | true |
f72c7be318686bd9cb0fbc1cd36a0d2e3f43d059 | 823 | py | Python | time_extract.py | jianantian/entity_recognizer | bcd02c4f46ec290a7710f7cefef66e17dc97a020 | [
"MIT"
] | null | null | null | time_extract.py | jianantian/entity_recognizer | bcd02c4f46ec290a7710f7cefef66e17dc97a020 | [
"MIT"
] | 2 | 2018-07-02T06:18:32.000Z | 2020-07-08T03:15:53.000Z | time_extract.py | jianantian/entity_recognizer | bcd02c4f46ec290a7710f7cefef66e17dc97a020 | [
"MIT"
] | null | null | null |
def find_exact_time(text):
"""从文本中发现确切表述的时间, 如2012-09-03 2014-07- 2014-07 2015年08月下旬 2015年08月 2015年9月17日, 并不提取表示时间段的词语, 如三月前等"""
import re
#匹配具体时间点, 如2012-09-03, 2014-07-, 2014-07, 2015年08月下旬, 2015年08月, 2015年9月17日, 03年, 2009年
time_re_1 = r'\d{2,4}[-年](?:\d{1,2})?[-月]?(?:\d{1,2})?(?:日|号|下旬|上... | 39.190476 | 117 | 0.579587 |
def find_exact_time(text):
"""从文本中发现确切表述的时间, 如2012-09-03 2014-07- 2014-07 2015年08月下旬 2015年08月 2015年9月17日, 并不提取表示时间段的词语, 如三月前等"""
import re
time_re_1 = r'\d{2,4}[-年](?:\d{1,2})?[-月]?(?:\d{1,2})?(?:日|号|下旬|上旬|上旬|初|末|中)?(?![前后内余])'
time_re_2 = r'(?:病(?:史|程))?(?<![\d年月周日-])... | false | true |
f72c7bed0beea334637a18a2edf4a3137820bc39 | 6,213 | py | Python | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.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 ... | 47.792308 | 242 | 0.652503 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class PercentileSourceTargetOperations(object):
models = models
def __init__(self, client, config, serializer, deserializer):
self._client = client
... | true | true |
f72c7c71e236df55dac3c772bf1accd371c155c5 | 586 | py | Python | python/sdssdb/__init__.py | albireox/sdssdb | 02d165d3a4347e8241aacdbdca0cec86058c8d29 | [
"BSD-3-Clause"
] | 6 | 2019-04-10T21:28:44.000Z | 2021-03-01T18:39:55.000Z | python/sdssdb/__init__.py | albireox/sdssdb | 02d165d3a4347e8241aacdbdca0cec86058c8d29 | [
"BSD-3-Clause"
] | 44 | 2018-10-31T17:48:20.000Z | 2022-01-27T20:52:26.000Z | python/sdssdb/__init__.py | albireox/sdssdb | 02d165d3a4347e8241aacdbdca0cec86058c8d29 | [
"BSD-3-Clause"
] | 2 | 2021-07-13T17:09:43.000Z | 2021-07-13T19:33:18.000Z | # encoding: utf-8
import warnings
from sdsstools import get_config, get_logger, get_package_version
warnings.filterwarnings(
'ignore', '.*Skipped unsupported reflection of expression-based index .*q3c.*')
NAME = 'sdssdb'
__version__ = get_package_version(path=__file__, package_name=NAME)
log = get_logger(NA... | 24.416667 | 83 | 0.776451 |
import warnings
from sdsstools import get_config, get_logger, get_package_version
warnings.filterwarnings(
'ignore', '.*Skipped unsupported reflection of expression-based index .*q3c.*')
NAME = 'sdssdb'
__version__ = get_package_version(path=__file__, package_name=NAME)
log = get_logger(NAME)
config = g... | true | true |
f72c7c8922dfe217f75499b4645d20bbcc563d6b | 768 | py | Python | saltapi/loader.py | techdragon/salt-api | e1ea6dd89bca61a7b8e885efcbc818faea33ea51 | [
"Apache-2.0"
] | 1 | 2019-06-27T13:05:14.000Z | 2019-06-27T13:05:14.000Z | saltapi/loader.py | techdragon/salt-api | e1ea6dd89bca61a7b8e885efcbc818faea33ea51 | [
"Apache-2.0"
] | null | null | null | saltapi/loader.py | techdragon/salt-api | e1ea6dd89bca61a7b8e885efcbc818faea33ea51 | [
"Apache-2.0"
] | null | null | null | '''
The salt api module loader interface
'''
# Import python libs
import os
# Import Salt libs
import salt.loader
import saltapi
def netapi(opts):
'''
Return the network api functions
'''
load = salt.loader._create_loader(
opts,
'netapi',
'netapi',
base... | 20.756757 | 71 | 0.580729 |
import os
import salt.loader
import saltapi
def netapi(opts):
load = salt.loader._create_loader(
opts,
'netapi',
'netapi',
base_path=os.path.dirname(saltapi.__file__)
)
return load.gen_functions()
def runner(opts):
load = salt.loader._create_... | true | true |
f72c7ca68f363a382646aaf1c7a8b8116abf92d5 | 51,548 | py | Python | Lib/test/test_compile.py | emontnemery/cpython | 99fcf1505218464c489d419d4500f126b6d6dc28 | [
"0BSD"
] | 18 | 2017-09-21T18:22:31.000Z | 2022-02-22T19:40:01.000Z | Lib/test/test_compile.py | emontnemery/cpython | 99fcf1505218464c489d419d4500f126b6d6dc28 | [
"0BSD"
] | 25 | 2020-04-16T17:21:30.000Z | 2022-03-01T05:00:45.000Z | Lib/test/test_compile.py | emontnemery/cpython | 99fcf1505218464c489d419d4500f126b6d6dc28 | [
"0BSD"
] | 8 | 2018-08-31T07:49:21.000Z | 2020-11-21T21:31:48.000Z | import dis
import math
import os
import unittest
import sys
import ast
import _ast
import tempfile
import types
import textwrap
from test import support
from test.support import script_helper, requires_debug_ranges
from test.support.os_helper import FakePath
class TestSpecifics(unittest.TestCase):
def compile_si... | 34.782726 | 95 | 0.536122 | import dis
import math
import os
import unittest
import sys
import ast
import _ast
import tempfile
import types
import textwrap
from test import support
from test.support import script_helper, requires_debug_ranges
from test.support.os_helper import FakePath
class TestSpecifics(unittest.TestCase):
def compile_si... | true | true |
f72c7e77f2ce593a9f65d35942b6d6d6225b5155 | 1,001 | py | Python | audiovisual_stream.py | yagguc/deep_impression | ad45d6640cdb46ff68dd44d8055b53ac57f3d342 | [
"MIT"
] | 36 | 2016-11-10T08:05:08.000Z | 2022-03-25T12:55:55.000Z | audiovisual_stream.py | yagguc/deep_impression | ad45d6640cdb46ff68dd44d8055b53ac57f3d342 | [
"MIT"
] | 5 | 2018-01-04T02:03:21.000Z | 2022-03-13T13:04:56.000Z | audiovisual_stream.py | yagguc/deep_impression | ad45d6640cdb46ff68dd44d8055b53ac57f3d342 | [
"MIT"
] | 24 | 2016-09-26T01:41:31.000Z | 2022-03-07T08:16:58.000Z | import auditory_stream
import chainer
import visual_stream
### MODEL ###
class ResNet18(chainer.Chain):
def __init__(self):
super(ResNet18, self).__init__(
aud = auditory_stream.ResNet18(),
vis = visual_stream.ResNet18(),
fc = chainer.links.Linear(512, 5, initialW = chai... | 41.708333 | 212 | 0.621379 | import auditory_stream
import chainer
import visual_stream
):
def __init__(self):
super(ResNet18, self).__init__(
aud = auditory_stream.ResNet18(),
vis = visual_stream.ResNet18(),
fc = chainer.links.Linear(512, 5, initialW = chainer.initializers.HeNormal())
)
... | true | true |
f72c7eba9adcee72dd6bb67f5e168999469e292c | 1,058 | py | Python | XXBDailyFresh/apps/user/urls.py | sixTiger/XXBDailyFresh | 5c6976eff8e073f79b50e7829e10332ccd8df43d | [
"MIT"
] | null | null | null | XXBDailyFresh/apps/user/urls.py | sixTiger/XXBDailyFresh | 5c6976eff8e073f79b50e7829e10332ccd8df43d | [
"MIT"
] | null | null | null | XXBDailyFresh/apps/user/urls.py | sixTiger/XXBDailyFresh | 5c6976eff8e073f79b50e7829e10332ccd8df43d | [
"MIT"
] | null | null | null | """XXBDailyFresh URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... | 39.185185 | 81 | 0.680529 |
.urls import path
from apps.user.views import RegisterView
urlpatterns = [
path('register/', RegisterView.as_view(), name='register'),
| true | true |
f72c7fa8536014c7a70bc5bf40a892ab8804afca | 4,820 | py | Python | Tsukihime/nscript_parser.py | Samyuth/LomandoCrawler | 2d6bc7bd79678b78ac7c30e88b72127134e99b91 | [
"MIT"
] | null | null | null | Tsukihime/nscript_parser.py | Samyuth/LomandoCrawler | 2d6bc7bd79678b78ac7c30e88b72127134e99b91 | [
"MIT"
] | 1 | 2022-03-31T09:40:48.000Z | 2022-03-31T09:44:48.000Z | Tsukihime/nscript_parser.py | Samyuth/LomandoCrawler | 2d6bc7bd79678b78ac7c30e88b72127134e99b91 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 16 02:05:23 2022
@author: Sagi
"""
'''
Sample choice node text:
;-BLOCK-------------------------------------------------------------------------
*f20 # Label
gosub *regard_update
!sd
if %sceneskip==1 && %1020==1 skip 4
gosub *s20
mov %1020,1
skip 9
`You have already vie... | 27.542857 | 94 | 0.527386 |
import re
from Graph import *
class TextNode():
def __init__(self, label=None, text=None, children=None):
if label is not None:
self.label = label
else:
self.label = None
if text is not None:
self.text = text
else:
self.text = ""
... | true | true |
f72c801333b8f88f7e05b48145bad8b1ff95ff41 | 2,251 | py | Python | analyse_play.py | illume/eyestabs | 9ce717743a6a4fe7b561c68599e9352da3acf080 | [
"Unlicense"
] | null | null | null | analyse_play.py | illume/eyestabs | 9ce717743a6a4fe7b561c68599e9352da3acf080 | [
"Unlicense"
] | null | null | null | analyse_play.py | illume/eyestabs | 9ce717743a6a4fe7b561c68599e9352da3acf080 | [
"Unlicense"
] | null | null | null | ################################################################################
# STD LIBS
import sys
# 3RD PARTY LIBS
import numpy
import pyaudio
import analyse
# USER LIBS
import notes
import timing
from constants import *
#####################################################################... | 25.292135 | 81 | 0.524656 | false | true | |
f72c80155df71399c41c13f3793341aca06db318 | 2,677 | py | Python | plugins/cylance_protect/unit_test/test_update_agent.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/cylance_protect/unit_test/test_update_agent.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/cylance_protect/unit_test/test_update_agent.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import sys
import os
sys.path.append(os.path.abspath("../"))
from unittest import TestCase
from icon_cylance_protect.connection.connection import Connection
from icon_cylance_protect.actions.update_agent import UpdateAgent
import json
import logging
class TestUpdateAgent(TestCase):
def test_integration_update_a... | 36.671233 | 116 | 0.668285 | import sys
import os
sys.path.append(os.path.abspath("../"))
from unittest import TestCase
from icon_cylance_protect.connection.connection import Connection
from icon_cylance_protect.actions.update_agent import UpdateAgent
import json
import logging
class TestUpdateAgent(TestCase):
def test_integration_update_a... | true | true |
f72c80b9bc4510e5476205c3adf1bfd5dea678af | 1,931 | py | Python | model-optimizer/extensions/front/onnx/detectionoutput_ext.py | Andruxin52rus/openvino | d824e371fe7dffb90e6d3d58e4e34adecfce4606 | [
"Apache-2.0"
] | 2 | 2020-11-18T14:14:06.000Z | 2020-11-28T04:55:57.000Z | model-optimizer/extensions/front/onnx/detectionoutput_ext.py | Andruxin52rus/openvino | d824e371fe7dffb90e6d3d58e4e34adecfce4606 | [
"Apache-2.0"
] | 30 | 2020-11-13T11:44:07.000Z | 2022-02-21T13:03:16.000Z | model-optimizer/extensions/front/onnx/detectionoutput_ext.py | mmakridi/openvino | 769bb7709597c14debdaa356dd60c5a78bdfa97e | [
"Apache-2.0"
] | 3 | 2021-03-09T08:27:29.000Z | 2021-04-07T04:58:54.000Z | """
Copyright (C) 2018-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 43.886364 | 109 | 0.684619 |
from math import log
import numpy as np
from extensions.ops.detectionoutput_onnx import ExperimentalDetectronDetectionOutput
from mo.front.extractor import FrontExtractorOp
from mo.front.onnx.extractors.utils import onnx_attr
class ExperimentalDetectronDetectionOutputFrontExtractor(FrontExtractorOp):
op = 'Exp... | true | true |
f72c811a9b903e14fbd5d11e5e45b9449c6237b3 | 2,159 | py | Python | test/chemistry/test_driver_gaussian_extra.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | 2 | 2020-06-29T16:08:12.000Z | 2020-08-07T22:42:13.000Z | test/chemistry/test_driver_gaussian_extra.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | null | null | null | test/chemistry/test_driver_gaussian_extra.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | 1 | 2022-01-25T07:09:10.000Z | 2022-01-25T07:09:10.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 36.59322 | 85 | 0.672534 |
import unittest
from test.chemistry import QiskitChemistryTestCase
from qiskit.chemistry.drivers import GaussianDriver
def _check_valid():
pass
class TestDriverGaussianExtra(QiskitChemistryTestCase):
def setUp(self):
super().setUp()
self.good_check = GaussianDriver._chec... | true | true |
f72c82f4acdaefe35bcc5d195dbe520974fda99d | 1,269 | py | Python | qiskit_nature/algorithms/excited_states_solvers/__init__.py | divshacker/qiskit-nature | 08f6dcec5e4ac8c08f5b84e764ee78cc3d12facb | [
"Apache-2.0"
] | 132 | 2021-01-28T14:51:11.000Z | 2022-03-25T21:10:47.000Z | qiskit_nature/algorithms/excited_states_solvers/__init__.py | divshacker/qiskit-nature | 08f6dcec5e4ac8c08f5b84e764ee78cc3d12facb | [
"Apache-2.0"
] | 449 | 2021-01-28T19:57:43.000Z | 2022-03-31T17:01:50.000Z | qiskit_nature/algorithms/excited_states_solvers/__init__.py | divshacker/qiskit-nature | 08f6dcec5e4ac8c08f5b84e764ee78cc3d12facb | [
"Apache-2.0"
] | 109 | 2021-01-28T13:17:46.000Z | 2022-03-30T23:53:39.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 28.840909 | 89 | 0.711584 |
from .excited_states_solver import ExcitedStatesSolver
from .qeom import QEOM
from .eigensolver_factories import EigensolverFactory, NumPyEigensolverFactory
from .excited_states_eigensolver import ExcitedStatesEigensolver
__all__ = [
"ExcitedStatesSolver",
"ExcitedStatesEigensolver",
"Eigensol... | true | true |
f72c838e66c47527c0a178012ed8acbdbcfe18e4 | 827 | gyp | Python | ui/aura_extra/aura_extra.gyp | hefen1/chromium | 52f0b6830e000ca7c5e9aa19488af85be792cc88 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ui/aura_extra/aura_extra.gyp | hefen1/chromium | 52f0b6830e000ca7c5e9aa19488af85be792cc88 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ui/aura_extra/aura_extra.gyp | hefen1/chromium | 52f0b6830e000ca7c5e9aa19488af85be792cc88 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2020-04-04T13:34:56.000Z | 2020-11-04T07:17:52.000Z | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
# GN version: //ui/aura_extra
'target_name': 'aura_extra',
'type': '<(... | 24.323529 | 72 | 0.53688 |
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
'target_name': 'aura_extra',
'type': '<(component)',
'dependencies': [
'../../base/base.gyp:base',
'../../skia/skia.gyp:skia',
'../aura/aura.gyp:aura',
'../base/ui_base.gyp:ui_base',
... | true | true |
f72c844451481add20eff334fb82624c5d7efbe7 | 1,662 | py | Python | lab-05-1-logistic_regression.py | KANG91/Deep_Learning | e3e9de769ab835215d0ebeee79ff869afbe64ebf | [
"MIT"
] | null | null | null | lab-05-1-logistic_regression.py | KANG91/Deep_Learning | e3e9de769ab835215d0ebeee79ff869afbe64ebf | [
"MIT"
] | null | null | null | lab-05-1-logistic_regression.py | KANG91/Deep_Learning | e3e9de769ab835215d0ebeee79ff869afbe64ebf | [
"MIT"
] | null | null | null | # Lab 5 Logistic Regression Classifier
import tensorflow as tf
tf.set_random_seed(777) # for reproducibility
x_data = [[1, 2], [2, 3], [3, 1], [4, 3], [5, 3], [6, 2]]
y_data = [[0], [0], [0], [1], [1], [1]]
# placeholders for a tensor that will be always fed.
X = tf.placeholder(tf.float32, shape=[None, 2])
Y = tf.pl... | 28.169492 | 76 | 0.628159 |
import tensorflow as tf
tf.set_random_seed(777)
x_data = [[1, 2], [2, 3], [3, 1], [4, 3], [5, 3], [6, 2]]
y_data = [[0], [0], [0], [1], [1], [1]]
X = tf.placeholder(tf.float32, shape=[None, 2])
Y = tf.placeholder(tf.float32, shape=[None, 1])
W = tf.Variable(tf.random_normal([2, 1]), name='weight')
b = tf.Variabl... | true | true |
f72c8477a6936f3991993793141885a0bb21af12 | 4,436 | py | Python | tests/unit/models/physics/MeniscusTest.py | edgargmartinez/OpenPNM | c68745993b3e9895f53938164a9cf6305500748e | [
"MIT"
] | 3 | 2019-07-05T22:07:21.000Z | 2019-07-05T22:07:30.000Z | tests/unit/models/physics/MeniscusTest.py | edgargmartinez/OpenPNM | c68745993b3e9895f53938164a9cf6305500748e | [
"MIT"
] | null | null | null | tests/unit/models/physics/MeniscusTest.py | edgargmartinez/OpenPNM | c68745993b3e9895f53938164a9cf6305500748e | [
"MIT"
] | null | null | null | import openpnm as op
import openpnm.models.physics as pm
import scipy as sp
class MeniscusTest:
def setup_class(self):
sp.random.seed(1)
self.net = op.network.Cubic(shape=[5, 1, 5], spacing=5e-5)
self.geo = op.geometry.StickAndBall(network=self.net,
... | 37.277311 | 72 | 0.511046 | import openpnm as op
import openpnm.models.physics as pm
import scipy as sp
class MeniscusTest:
def setup_class(self):
sp.random.seed(1)
self.net = op.network.Cubic(shape=[5, 1, 5], spacing=5e-5)
self.geo = op.geometry.StickAndBall(network=self.net,
... | true | true |
f72c85576b8389695f555dc9f2032aaaf2f1f2df | 19,881 | py | Python | plugins/modules/oci_network_drg.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_network_drg.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_network_drg.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 41.076446 | 160 | 0.632866 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
"metadata_version": "1.1",
"status": ["preview"],
"supported_by": "community",
}
DOCUMENTATION = """
---
module: oci_network_drg
short_description: Manage a Drg resource in Oracle Cloud Inf... | true | true |
f72c8559dfd7a6014d9c69e946707586ad068801 | 2,817 | py | Python | src/dashboard/pages/visualization/visualization.py | ddlatumalea/disease_and_life | aa8c84fdd4a0b41bc0ee275538ac70a362eb26ba | [
"Apache-2.0"
] | null | null | null | src/dashboard/pages/visualization/visualization.py | ddlatumalea/disease_and_life | aa8c84fdd4a0b41bc0ee275538ac70a362eb26ba | [
"Apache-2.0"
] | null | null | null | src/dashboard/pages/visualization/visualization.py | ddlatumalea/disease_and_life | aa8c84fdd4a0b41bc0ee275538ac70a362eb26ba | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import panel as pn
import pandas as pd
import plotly.express as px
from models.pages import Page
from models.utils.paths import get_prepared_data_path, get_standardized_data_file
from dashboard.widgets import heatmap
PREPARED_DATA_DIR = get_prepared_data_path()
PREPARED_DATA_FILE = get_stand... | 32.011364 | 111 | 0.624778 | from pathlib import Path
import panel as pn
import pandas as pd
import plotly.express as px
from models.pages import Page
from models.utils.paths import get_prepared_data_path, get_standardized_data_file
from dashboard.widgets import heatmap
PREPARED_DATA_DIR = get_prepared_data_path()
PREPARED_DATA_FILE = get_stand... | true | true |
f72c85a0942c0540d2abee2d9180bd484b5864a7 | 6,141 | py | Python | main.py | akashrchandran/pokeowo | 0b2621494ef56f350239817546b843814fe3448e | [
"MIT"
] | null | null | null | main.py | akashrchandran/pokeowo | 0b2621494ef56f350239817546b843814fe3448e | [
"MIT"
] | null | null | null | main.py | akashrchandran/pokeowo | 0b2621494ef56f350239817546b843814fe3448e | [
"MIT"
] | null | null | null | import datetime
import json
import multiprocessing
import os
import random
import re
import time
import discum
version = 'v0.01'
config_path = 'data/config.json'
logo = f'''
###### ### ### ## ####### ### ## ## ###
## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ... | 37.218182 | 96 | 0.485752 | import datetime
import json
import multiprocessing
import os
import random
import re
import time
import discum
version = 'v0.01'
config_path = 'data/config.json'
logo = f'''
###### ### ### ## ####### ### ## ## ###
## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ... | true | true |
f72c86f6141b9e5ce714030b5766cf7cff25194c | 1,327 | py | Python | isolated_functions.py | wonabru/chainnet | f8ec1e2b580af837cba3322ffe69b95156b1b9a1 | [
"MIT"
] | 5 | 2019-04-20T18:54:55.000Z | 2019-08-23T09:17:20.000Z | isolated_functions.py | wonabru/chainnet | f8ec1e2b580af837cba3322ffe69b95156b1b9a1 | [
"MIT"
] | null | null | null | isolated_functions.py | wonabru/chainnet | f8ec1e2b580af837cba3322ffe69b95156b1b9a1 | [
"MIT"
] | null | null | null | import ast
import re
import pickle
from Crypto.PublicKey import RSA
from base64 import b64decode,b64encode
from tkinter import messagebox
def str2obj(s):
return ast.literal_eval(s.replace('true', 'True').replace('false', 'False'))
def trim_name(name):
return name.replace('@','').replace('#','')
def remove_sp... | 21.063492 | 117 | 0.679729 | import ast
import re
import pickle
from Crypto.PublicKey import RSA
from base64 import b64decode,b64encode
from tkinter import messagebox
def str2obj(s):
return ast.literal_eval(s.replace('true', 'True').replace('false', 'False'))
def trim_name(name):
return name.replace('@','').replace('#','')
def remove_sp... | true | true |
f72c87804c39b074934faddfa6a15a81e1a36cb8 | 4,587 | py | Python | robot/hsin_agent.py | kanokkorn/watering_robot | b39fed532519e2b89a9f1ae1a3d1b72bb550cc1b | [
"MIT"
] | 5 | 2020-04-01T13:55:12.000Z | 2022-03-04T03:32:25.000Z | robot/hsin_agent.py | kanokkorn/watering_robot | b39fed532519e2b89a9f1ae1a3d1b72bb550cc1b | [
"MIT"
] | 7 | 2019-12-21T10:26:40.000Z | 2021-06-25T15:15:05.000Z | robot/hsin_agent.py | kanokkorn/watering_robot | b39fed532519e2b89a9f1ae1a3d1b72bb550cc1b | [
"MIT"
] | 1 | 2020-06-03T07:41:21.000Z | 2020-06-03T07:41:21.000Z | # import modules
from gps3 import gps3
import serial
import math
import time
import csv
import os
# setup gps socket
ser = serial.Serial("/dev/ttyUSB0", 9600)
gps_socket = gps3.GPSDSocket()
data_stream = gps3.DataStream()
gps_socket.connect()
gps_socket.watch()
# read csv files
def track():
# prefix parameter
... | 36.404762 | 105 | 0.419228 |
from gps3 import gps3
import serial
import math
import time
import csv
import os
ser = serial.Serial("/dev/ttyUSB0", 9600)
gps_socket = gps3.GPSDSocket()
data_stream = gps3.DataStream()
gps_socket.connect()
gps_socket.watch()
def track():
distance = 10
earth_radius = 6371e3
k = 1
with open(... | true | true |
f72c8854af948f34376eadc837477a9b431ff2c9 | 2,138 | py | Python | app/core/radiofrequency/__init__.py | FHellmann/MLWTF | 582c3505d638907a848d5a6c739ee99981300f17 | [
"Apache-2.0"
] | null | null | null | app/core/radiofrequency/__init__.py | FHellmann/MLWTF | 582c3505d638907a848d5a6c739ee99981300f17 | [
"Apache-2.0"
] | null | null | null | app/core/radiofrequency/__init__.py | FHellmann/MLWTF | 582c3505d638907a848d5a6c739ee99981300f17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
"""
Author: Fabio Hellmann <info@fabio-hellmann.de>
This is a layer between the raw execution unit and the database.
"""
import logging
from datetime import datetime
from . import rf_rpi
from .models import Protocol, Signal
from ..gpio import RaspberryPi3 as GPIO_PI
from app.database impor... | 30.985507 | 120 | 0.713751 |
import logging
from datetime import datetime
from . import rf_rpi
from .models import Protocol, Signal
from ..gpio import RaspberryPi3 as GPIO_PI
from app.database import db
from app.database.models import DataSource, DataSourceType
from app.database.converter import converter
_LOGGER = logging.getLogger(__name__)... | true | true |
f72c886994bd9fb0a5722665191651370d918e92 | 2,908 | py | Python | tests/riscv/APIs/State_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | 111 | 2020-06-12T22:31:30.000Z | 2022-03-19T03:45:20.000Z | tests/riscv/APIs/State_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | 34 | 2020-06-12T20:23:40.000Z | 2022-03-15T20:04:31.000Z | tests/riscv/APIs/State_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | 32 | 2020-06-12T19:15:26.000Z | 2022-02-20T11:38:31.000Z | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PR... | 38.263158 | 77 | 0.725241 |
import RandomUtils
from Enums import EStateElementDuplicateMode
from State import State
from base.Sequence import Sequence
from riscv.EnvRISCV import EnvRISCV
from riscv.GenThreadRISCV import GenThreadRISCV
class MainSequence(Sequence):
def generate(self, **kargs):
state = State()
... | true | true |
f72c88bad07b64edf6012e96a4a6af0ebf4b41c8 | 12,698 | py | Python | mai_version/trees/TILDEQueryScorer.py | joschout/tilde | 1403b50842b83f2edd6b16b1fbe24b9bec2d0048 | [
"Apache-2.0"
] | 16 | 2019-03-06T06:11:33.000Z | 2022-02-07T21:30:25.000Z | mai_version/trees/TILDEQueryScorer.py | joschout/tilde | 1403b50842b83f2edd6b16b1fbe24b9bec2d0048 | [
"Apache-2.0"
] | 4 | 2019-10-08T14:48:23.000Z | 2020-03-26T00:31:57.000Z | mai_version/trees/TILDEQueryScorer.py | krishnangovindraj/tilde | 5243a02d92f375d56ffc49ab8c3d1a87e31e99b9 | [
"Apache-2.0"
] | 4 | 2019-08-14T05:40:47.000Z | 2020-08-05T13:21:16.000Z | import math
from typing import Iterable, Set, List, Optional
import problog
import time
from problog.logic import And, Term
from mai_version.classification.example_partitioning import ExamplePartitioner
from mai_version.representation.TILDE_query import TILDEQuery
from mai_version.representation.example import Exampl... | 52.040984 | 158 | 0.654198 | import math
from typing import Iterable, Set, List, Optional
import problog
import time
from problog.logic import And, Term
from mai_version.classification.example_partitioning import ExamplePartitioner
from mai_version.representation.TILDE_query import TILDEQuery
from mai_version.representation.example import Exampl... | true | true |
f72c8a7510c49c3ae446f48e397b061791a320e4 | 13,771 | py | Python | logreg.py | naver/cog | 5b34ca90757116b9cfae11d8838927ba73e1ede8 | [
"BSD-3-Clause"
] | 13 | 2021-10-13T11:13:55.000Z | 2022-03-11T04:41:41.000Z | logreg.py | naver/cog | 5b34ca90757116b9cfae11d8838927ba73e1ede8 | [
"BSD-3-Clause"
] | null | null | null | logreg.py | naver/cog | 5b34ca90757116b9cfae11d8838927ba73e1ede8 | [
"BSD-3-Clause"
] | null | null | null | # ImageNet-CoG Benchmark
# Copyright 2021-present NAVER Corp.
# 3-Clause BSD License
import argparse
import copy
import logging
import math
import os
import shutil
import time
import optuna
import torch as th
import feature_ops
import metrics
import utils
from iterators import TorchIterator
from meters import Avera... | 37.625683 | 140 | 0.600392 |
import argparse
import copy
import logging
import math
import os
import shutil
import time
import optuna
import torch as th
import feature_ops
import metrics
import utils
from iterators import TorchIterator
from meters import AverageMeter, ProgressMeter
logger = logging.getLogger()
class LogReg:
def __ini... | true | true |
f72c8ab58a23d585b39a3037e18747d52bcb4b75 | 1,132 | py | Python | Chapter02/Ch02_Code/GUI_tabbed_two_mighty_labels.py | mr4dsd43/Python-GUI-Programming-Cookbook-Second-Edition | 18e4632106169991e9b75680bdd7250c9d77c3be | [
"MIT"
] | 2 | 2021-01-12T03:13:29.000Z | 2021-01-12T03:13:31.000Z | Chapter02/Ch02_Code/GUI_tabbed_two_mighty_labels.py | mr4dsd43/Python-GUI-Programming-Cookbook-Second-Edition | 18e4632106169991e9b75680bdd7250c9d77c3be | [
"MIT"
] | null | null | null | Chapter02/Ch02_Code/GUI_tabbed_two_mighty_labels.py | mr4dsd43/Python-GUI-Programming-Cookbook-Second-Edition | 18e4632106169991e9b75680bdd7250c9d77c3be | [
"MIT"
] | 1 | 2022-02-22T02:06:32.000Z | 2022-02-22T02:06:32.000Z | '''
May 2017
@author: Burkhard A. Meier
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
# Create instance
win = tk.Tk()
# Add a title
win.title("Python GUI")
tabControl = ttk.Notebook(win) # Create Tab Control
tab1 = ttk.Frame(tabControl)... | 25.155556 | 65 | 0.620141 |
import tkinter as tk
from tkinter import ttk
win = tk.Tk()
win.title("Python GUI")
tabControl = ttk.Notebook(win)
tab1 = ttk.Frame(tabControl)
tabControl.add(tab1, text='Tab 1')
tab2 = ttk.Frame(tabControl)
tabControl.add(tab2, text='Tab 2')
tabControl.pack(exp... | true | true |
f72c8ecfbd321747538079c852e41d9f1f85d700 | 3,446 | py | Python | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_validate.py | kashifkhan/azure-sdk-for-python | 9c28b76e89b0855e41bd12d5b4a59b51acd47eec | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_validate.py | kashifkhan/azure-sdk-for-python | 9c28b76e89b0855e41bd12d5b4a59b51acd47eec | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_validate.py | kashifkhan/azure-sdk-for-python | 9c28b76e89b0855e41bd12d5b4a59b51acd47eec | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import functools
from ._version import VERSIONS_SUPPORTED
def check_for_unsupported_actions_types(*args, **kwargs):
client = args[0]
# this assumes the clien... | 35.163265 | 119 | 0.589089 |
import functools
from ._version import VERSIONS_SUPPORTED
def check_for_unsupported_actions_types(*args, **kwargs):
client = args[0]
selected_api_version = client._api_version
if "actions" not in kwargs:
actions = args[2]
else:
actions = kwargs.get("actions")
if acti... | true | true |
f72c8ed99253eaa655d08778cb9bf6fa834191af | 10,956 | py | Python | google/ads/google_ads/v0/proto/resources/shared_criterion_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v0/proto/resources/shared_criterion_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v0/proto/resources/shared_criterion_pb2.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v0/proto/resources/shared_criterion.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... | 59.221622 | 1,457 | 0.793264 |
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
_sym_db =... | true | true |
f72c907b1f918fdf342d234b59f8c92fc6aa1d93 | 2,070 | py | Python | cows_bulls.py | hmlewis-astro/coding_practice | a781443399766bf13df0d2de93f0ce3acda0c77d | [
"MIT"
] | null | null | null | cows_bulls.py | hmlewis-astro/coding_practice | a781443399766bf13df0d2de93f0ce3acda0c77d | [
"MIT"
] | null | null | null | cows_bulls.py | hmlewis-astro/coding_practice | a781443399766bf13df0d2de93f0ce3acda0c77d | [
"MIT"
] | null | null | null | '''
File name: pythonpractice.py
Author: Hannah Lewis
Date created: 08/03/2020
Date last modified: 08/03/2020
Python Version: 3.7
'''
import random
def main():
'''
Create a program that will play the “cows and bulls” game with the user.
'''
print("You will try to guess a random 4-digit nu... | 27.972973 | 117 | 0.522705 |
import random
def main():
print("You will try to guess a random 4-digit number.")
print("A 'cow' is a correct digit in the correct place.")
print("A 'bull' is a correct digit in the wrong place.")
print("The game ends when you get 4 cows!\n")
print("You can type 'exit' at any tim... | true | true |
f72c90b37b41d597ef1c839e1131577727a7329a | 227 | py | Python | game/admin.py | zxalif/simpleapi | 89d9f1c81b7c8e46d9764573fc1070a453751b4a | [
"MIT"
] | null | null | null | game/admin.py | zxalif/simpleapi | 89d9f1c81b7c8e46d9764573fc1070a453751b4a | [
"MIT"
] | 8 | 2020-06-05T23:34:44.000Z | 2022-02-10T09:11:05.000Z | game/admin.py | zxalif/simpleapi | 89d9f1c81b7c8e46d9764573fc1070a453751b4a | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import (
Category,
Game,
Thread,
ThreadImage
)
admin.site.register(Category)
admin.site.register(Game)
admin.site.register(Thread)
admin.site.register(ThreadImage) | 17.461538 | 32 | 0.748899 | from django.contrib import admin
from .models import (
Category,
Game,
Thread,
ThreadImage
)
admin.site.register(Category)
admin.site.register(Game)
admin.site.register(Thread)
admin.site.register(ThreadImage) | true | true |
f72c9168c0692e02e3f54b61d9c5f5e6399fc4d3 | 867 | py | Python | blog/pelican-plugins/headerid/headerid.py | lemonsong/lemonsong.github.io | 14a65b8c2506c95bab64f50143f3850be3edadc1 | [
"MIT"
] | null | null | null | blog/pelican-plugins/headerid/headerid.py | lemonsong/lemonsong.github.io | 14a65b8c2506c95bab64f50143f3850be3edadc1 | [
"MIT"
] | 1 | 2022-01-10T04:39:05.000Z | 2022-01-10T04:39:05.000Z | blog/pelican-plugins/headerid/headerid.py | lemonsong/lemonsong.github.io | 14a65b8c2506c95bab64f50143f3850be3edadc1 | [
"MIT"
] | null | null | null | from pelican import readers
from pelican.readers import PelicanHTMLTranslator
from pelican import signals
from docutils import nodes
def register():
class HeaderIDPatchedPelicanHTMLTranslator(PelicanHTMLTranslator):
def depart_title(self, node):
close_tag = self.context[-1]
parent =... | 43.35 | 113 | 0.635525 | from pelican import readers
from pelican.readers import PelicanHTMLTranslator
from pelican import signals
from docutils import nodes
def register():
class HeaderIDPatchedPelicanHTMLTranslator(PelicanHTMLTranslator):
def depart_title(self, node):
close_tag = self.context[-1]
parent =... | true | true |
f72c916ef8e95900c5ab3a87d685611c982bda39 | 2,960 | py | Python | linsae/cogs/Events.py | drakedeveloper/Linsae | 1a866fbb95df3a7270e446dca18e9dca8beb2c3a | [
"Apache-2.0"
] | 1 | 2019-06-27T00:47:21.000Z | 2019-06-27T00:47:21.000Z | linsae/cogs/Events.py | drakedeveloper/Linsae | 1a866fbb95df3a7270e446dca18e9dca8beb2c3a | [
"Apache-2.0"
] | null | null | null | linsae/cogs/Events.py | drakedeveloper/Linsae | 1a866fbb95df3a7270e446dca18e9dca8beb2c3a | [
"Apache-2.0"
] | null | null | null | import discord
import time
import asyncio
from datetime import datetime
import time
from discord.ext import tasks, commands
from tinydb import TinyDB, Query
import re
class Events(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_guild... | 55.849057 | 294 | 0.631419 | import discord
import time
import asyncio
from datetime import datetime
import time
from discord.ext import tasks, commands
from tinydb import TinyDB, Query
import re
class Events(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_guild... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.