hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c455a3b6c64198e9f6c6b8b99f938134a554603 | 817 | py | Python | mmelemental/models/forcefield/bonded/bonds/base.py | RlyehAD/mmelemental | 5f0754356fd2c89e9119cf810f1972430dfa75dc | [
"BSD-3-Clause"
] | null | null | null | mmelemental/models/forcefield/bonded/bonds/base.py | RlyehAD/mmelemental | 5f0754356fd2c89e9119cf810f1972430dfa75dc | [
"BSD-3-Clause"
] | null | null | null | mmelemental/models/forcefield/bonded/bonds/base.py | RlyehAD/mmelemental | 5f0754356fd2c89e9119cf810f1972430dfa75dc | [
"BSD-3-Clause"
] | null | null | null | from pydantic import Field
from mmelemental.models.forcefield.params import Params
from typing import Optional, List, Tuple, Union
from cmselemental.types import Array
import os
import pathlib
__all__ = ["Bonds"]
class Bonds(Params):
lengths: Array[float] = Field(
..., description="Equilibrium bond lengt... | 34.041667 | 119 | 0.684211 | from pydantic import Field
from mmelemental.models.forcefield.params import Params
from typing import Optional, List, Tuple, Union
from cmselemental.types import Array
import os
import pathlib
__all__ = ["Bonds"]
class Bonds(Params):
lengths: Array[float] = Field(
..., description="Equilibrium bond lengt... | true | true |
1c455aa0f8a6d073be57b1f48b7b42ece8de7bc8 | 22,104 | py | Python | cirq/ops/three_qubit_gates.py | Hongbo-Miao/Cirq | d6c6f9b1ea282e79db4475e5327d0380e6558ba6 | [
"Apache-2.0"
] | null | null | null | cirq/ops/three_qubit_gates.py | Hongbo-Miao/Cirq | d6c6f9b1ea282e79db4475e5327d0380e6558ba6 | [
"Apache-2.0"
] | null | null | null | cirq/ops/three_qubit_gates.py | Hongbo-Miao/Cirq | d6c6f9b1ea282e79db4475e5327d0380e6558ba6 | [
"Apache-2.0"
] | 1 | 2020-12-24T07:13:40.000Z | 2020-12-24T07:13:40.000Z | # Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.864353 | 100 | 0.513346 |
from typing import AbstractSet, Any, List, Optional, Tuple, TYPE_CHECKING
import numpy as np
import sympy
from cirq import linalg, protocols, value
from cirq._compat import proper_repr
from cirq._doc import document
from cirq.ops import (
common_gates,
controlled_gate,
eigen_gate,
gate_... | true | true |
1c455c21b416c77406ef8ef3f269649ffa99767d | 657 | py | Python | tests/while/test_while_class_in_body.py | sco1/pylox | b4820828306c20cee3f8533c2547fafb92c6c1bd | [
"MIT"
] | 2 | 2021-12-18T01:52:50.000Z | 2022-01-17T19:41:52.000Z | tests/while/test_while_class_in_body.py | sco1/pylox | b4820828306c20cee3f8533c2547fafb92c6c1bd | [
"MIT"
] | 18 | 2021-11-30T04:05:53.000Z | 2022-02-01T03:30:04.000Z | tests/while/test_while_class_in_body.py | sco1/pylox | b4820828306c20cee3f8533c2547fafb92c6c1bd | [
"MIT"
] | null | null | null | from textwrap import dedent
import pytest
from pylox.lox import Lox
# Base cases from https://github.com/munificent/craftinginterpreters/blob/master/test/while/class_in_body.lox
TEST_SRC = dedent(
"""\
// [line 2] Error at 'class': Expect expression.
while (true) class Foo {}
"""
)
EXPECTED_STDOUTS ... | 24.333333 | 109 | 0.727549 | from textwrap import dedent
import pytest
from pylox.lox import Lox
TEST_SRC = dedent(
"""\
// [line 2] Error at 'class': Expect expression.
while (true) class Foo {}
"""
)
EXPECTED_STDOUTS = ["2:14: LoxParseError: Expected expression."]
def test_class_in_body(capsys: pytest.CaptureFixture) -> No... | true | true |
1c455d20df340c5bca26c4bb77387d4e69955a1a | 364 | py | Python | tomwhite-hadoop-book/ch17-hive/src/main/python/max_temperature_reduce.py | booknu/study-hadoop-book | 68c9f00d224289c470ba03533c571492979d850f | [
"MIT"
] | null | null | null | tomwhite-hadoop-book/ch17-hive/src/main/python/max_temperature_reduce.py | booknu/study-hadoop-book | 68c9f00d224289c470ba03533c571492979d850f | [
"MIT"
] | 3 | 2021-08-02T17:05:27.000Z | 2022-02-09T22:28:27.000Z | tomwhite-hadoop-book/ch17-hive/src/main/python/max_temperature_reduce.py | booknu/study-hadoop-book | 68c9f00d224289c470ba03533c571492979d850f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
(last_key, max_val) = (None, 0)
for line in sys.stdin:
(key, val) = line.strip().split("\t")
if last_key and last_key != key:
print "%s\t%s" % (last_key, max_val)
(last_key, max_val) = (key, int(val))
else:
(last_key, max_val) = (key, max(max_val, int(val)))
if last... | 24.266667 | 55 | 0.615385 |
import sys
(last_key, max_val) = (None, 0)
for line in sys.stdin:
(key, val) = line.strip().split("\t")
if last_key and last_key != key:
print "%s\t%s" % (last_key, max_val)
(last_key, max_val) = (key, int(val))
else:
(last_key, max_val) = (key, max(max_val, int(val)))
if last_key:
print "%s\t%s... | false | true |
1c455d557f5e17a71c8823251f3fd837386f7ace | 2,004 | py | Python | launch/mouse_with_lidar.launch.py | rt-net/raspimouse_ros2_examples | f16aef6c087a6e6325801b9f6a10b272b4d59c91 | [
"Apache-2.0"
] | 30 | 2020-05-08T12:13:03.000Z | 2021-12-27T20:14:43.000Z | launch/mouse_with_lidar.launch.py | rt-net/raspimouse_ros2_examples | f16aef6c087a6e6325801b9f6a10b272b4d59c91 | [
"Apache-2.0"
] | 16 | 2020-05-28T02:35:24.000Z | 2021-12-10T05:41:31.000Z | launch/mouse_with_lidar.launch.py | rt-net/raspimouse_ros2_examples | f16aef6c087a6e6325801b9f6a10b272b4d59c91 | [
"Apache-2.0"
] | 4 | 2020-10-02T23:50:02.000Z | 2021-08-25T14:19:17.000Z | # Copyright 2020 RT 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 in writin... | 35.785714 | 75 | 0.72006 |
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import IncludeLaunchDescription
from launch.actions import OpaqueFunction
from launch.launch_description_sources import P... | true | true |
1c455e490ae1d668471a3db85f33281fb0cacecb | 1,017 | py | Python | CGPA_Claculator.py | DharaneeswaranR/CGPA-Calculator | ce8390288057ac8e1f79b2d76a233e63d6d7402c | [
"BSD-3-Clause"
] | 1 | 2021-11-20T15:42:15.000Z | 2021-11-20T15:42:15.000Z | CGPA_Claculator.py | DharaneeswaranR/CGPA-Calculator | ce8390288057ac8e1f79b2d76a233e63d6d7402c | [
"BSD-3-Clause"
] | null | null | null | CGPA_Claculator.py | DharaneeswaranR/CGPA-Calculator | ce8390288057ac8e1f79b2d76a233e63d6d7402c | [
"BSD-3-Clause"
] | null | null | null | def calculate_cgpa(grade_points, credits, num):
mark_sum = list()
for i in range(num):
Mark_sum.append(grade_points[i] * credits[i])
cgpa = sum(mark_sum) / sum(credits)
return cgpa
if __name__ == '__main__':
num = int(input("\nEnter number of subjects : "))
grade_points = list()
... | 26.763158 | 82 | 0.547689 | def calculate_cgpa(grade_points, credits, num):
mark_sum = list()
for i in range(num):
Mark_sum.append(grade_points[i] * credits[i])
cgpa = sum(mark_sum) / sum(credits)
return cgpa
if __name__ == '__main__':
num = int(input("\nEnter number of subjects : "))
grade_points = list()
... | true | true |
1c455ea2754f11157926ef47242fd8393fbd2d15 | 9,560 | py | Python | mlfromscratch/supervised_learning/regression.py | sourcepirate/ML-From-Scratch | c6839bf47c360d6fa48861302fd90ccd4a8c38db | [
"MIT"
] | null | null | null | mlfromscratch/supervised_learning/regression.py | sourcepirate/ML-From-Scratch | c6839bf47c360d6fa48861302fd90ccd4a8c38db | [
"MIT"
] | null | null | null | mlfromscratch/supervised_learning/regression.py | sourcepirate/ML-From-Scratch | c6839bf47c360d6fa48861302fd90ccd4a8c38db | [
"MIT"
] | 2 | 2017-10-03T07:45:16.000Z | 2018-12-21T01:31:21.000Z | from __future__ import print_function, division
import numpy as np
import math
from mlfromscratch.utils import normalize, polynomial_features
class Regression(object):
""" Base regression model. Models the relationship between a scalar dependent variable y and the independent
variables X.
Parameters:
... | 43.853211 | 114 | 0.688808 | from __future__ import print_function, division
import numpy as np
import math
from mlfromscratch.utils import normalize, polynomial_features
class Regression(object):
def __init__(self, reg_factor, n_iterations, learning_rate, gradient_descent):
self.w = None
self.n_iterations = n_iterations
... | true | true |
1c455f55b99a0f9313f7b61d44989bbe51ff3591 | 72,468 | py | Python | intersight/model/virtualization_vmware_datacenter_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/virtualization_vmware_datacenter_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/virtualization_vmware_datacenter_relationship.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 63.070496 | 1,678 | 0.659325 |
import re
import sys
from intersight.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def la... | true | true |
1c455fa5c65ef452e853463256b07757be1b7bac | 41,048 | py | Python | lib/matplotlib/lines.py | SoftwareDev/mat-plot-lib | abaf94859d5ef6e653a4d8a7ce2c59cea1724a57 | [
"MIT",
"BSD-3-Clause"
] | 3 | 2015-02-25T21:51:26.000Z | 2020-01-05T14:11:52.000Z | lib/matplotlib/lines.py | SoftwareDev/mat-plot-lib | abaf94859d5ef6e653a4d8a7ce2c59cea1724a57 | [
"MIT",
"BSD-3-Clause"
] | 7 | 2015-05-08T19:36:25.000Z | 2015-06-30T15:32:17.000Z | lib/matplotlib/lines.py | OceanWolf/matplotlib | a429c415bdb6e54ccfe004a48fdc034ea8e9d329 | [
"MIT",
"BSD-3-Clause"
] | 6 | 2015-06-05T03:34:06.000Z | 2022-01-25T09:07:10.000Z | """
This module contains all the 2D line class which can draw with a
variety of line styles, markers and colors.
"""
# TODO: expose cap and join style attrs
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import warnings
import numpy as np
from... | 32.474684 | 79 | 0.568018 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import warnings
import numpy as np
from numpy import ma
from matplotlib import verbose
from . import artist
from .artist import Artist
from .cbook import iterable, is_string_like, is_numlike, ls_... | true | true |
1c456142bbc95af7e87173cb0cb84afd5f28b013 | 929 | py | Python | interprete/src/models/gpt/example.py | serjtroshin/PLBART | 58e5de3041a2fc8b98e54648c6489fb3c23db9cb | [
"MIT"
] | null | null | null | interprete/src/models/gpt/example.py | serjtroshin/PLBART | 58e5de3041a2fc8b98e54648c6489fb3c23db9cb | [
"MIT"
] | null | null | null | interprete/src/models/gpt/example.py | serjtroshin/PLBART | 58e5de3041a2fc8b98e54648c6489fb3c23db9cb | [
"MIT"
] | null | null | null | # from transformers import pipeline
# generator = pipeline('text-generation', model='EleutherAI/gpt-neo-2.7B')
# generator("EleutherAI has", do_sample=True, min_length=50)
# [{'generated_text': 'EleutherAI has made a commitment to create new software packages for each of its major clients and has'}]
from transformers... | 42.227273 | 128 | 0.779333 |
from transformers import GPT2Tokenizer, GPT2Model
model_name = "microsoft/CodeGPT-small-java-adaptedGPT2"
tokenizer = GPT2Tokenizer.from_pretrained(model_name)
model = GPT2Model.from_pretrained(model_name)
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')
prin... | true | true |
1c456237e48e7b21db5e6e1bb2ccae546249bad4 | 7,590 | py | Python | prov/constants.py | AndreiFrunze/wrangler | 076a07de00fc966dcf18ca6b6a6e804be5245ed9 | [
"Apache-2.0"
] | 2 | 2017-09-07T04:33:18.000Z | 2019-01-07T13:32:15.000Z | prov/constants.py | AndreiFrunze/wrangler | 076a07de00fc966dcf18ca6b6a6e804be5245ed9 | [
"Apache-2.0"
] | 2 | 2016-10-06T13:07:05.000Z | 2017-12-20T09:47:08.000Z | prov/constants.py | AndreiFrunze/wrangler | 076a07de00fc966dcf18ca6b6a6e804be5245ed9 | [
"Apache-2.0"
] | 5 | 2016-09-01T08:38:20.000Z | 2018-08-28T12:08:39.000Z | from __future__ import (absolute_import, division, print_function,
unicode_literals)
__author__ = 'Trung Dong Huynh'
__email__ = 'trungdong@donggiang.com'
import six
# # PROV record constants - PROV-DM
# Built-in namespaces
from prov.identifier import Namespace
XSD = Namespace('xsd', 'http... | 33.584071 | 75 | 0.691304 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
__author__ = 'Trung Dong Huynh'
__email__ = 'trungdong@donggiang.com'
import six
mespace
XSD = Namespace('xsd', 'http://www.w3.org/2001/XMLSchema#')
PROV = Namespace('prov', 'http://www.w3.org/ns/prov#')
XSI... | true | true |
1c45639a0e721d5529cabef77a05e804e7bcec90 | 3,371 | py | Python | application/app.py | StephenSpicer/airbnb_app | ea9b92dbd35d508d2f819255d026b299d63285a8 | [
"MIT"
] | null | null | null | application/app.py | StephenSpicer/airbnb_app | ea9b92dbd35d508d2f819255d026b299d63285a8 | [
"MIT"
] | null | null | null | application/app.py | StephenSpicer/airbnb_app | ea9b92dbd35d508d2f819255d026b299d63285a8 | [
"MIT"
] | null | null | null | # Import Statements
import pandas as pd
from flask import Flask, render_template, request
from joblib import load
from .predict import get_prediction
# Instantiate Application
# def create_app():
# app = Flask(__name__)
# @app.route('/')
# def hello_heroku():
# return "hello heroku"
# return a... | 34.752577 | 114 | 0.589143 |
import pandas as pd
from flask import Flask, render_template, request
from joblib import load
from .predict import get_prediction
def create_app():
app = Flask(__name__)
load_model = load('application/finalized_model.sav')
@app.route('/')
def form():
return render_template... | true | true |
1c456470d18841deab9b9d0f37410c49dd5f194b | 8,894 | py | Python | dragonfly/opt/multiobjective_optimiser.py | hase1128/dragonfly | 4be7e4c539d3edccc4d243ab9f972b1ffb0d9a5c | [
"MIT"
] | null | null | null | dragonfly/opt/multiobjective_optimiser.py | hase1128/dragonfly | 4be7e4c539d3edccc4d243ab9f972b1ffb0d9a5c | [
"MIT"
] | null | null | null | dragonfly/opt/multiobjective_optimiser.py | hase1128/dragonfly | 4be7e4c539d3edccc4d243ab9f972b1ffb0d9a5c | [
"MIT"
] | null | null | null | """
Defines a class for Multi-objective Blackbox Optimisation.
-- bparia@cs.cmu.edu
-- kandasamy@cs.cmu.edu
"""
# NB: In this file, the acronym MOO/moo refers to multi-objective optimisation. --KK
# pylint: disable=abstract-class-little-used
# pylint: disable=invalid-name
from __future__ import division
from a... | 40.798165 | 88 | 0.723746 |
from __future__ import division
from argparse import Namespace
import numpy as np
from ..exd.exd_core import ExperimentDesigner, exd_core_args
from ..exd.experiment_caller import MultiFunctionCaller, FunctionCaller
from ..utils.general_utils import update_pareto_set
multiobjective_opt_args = exd_core_args
_NO... | true | true |
1c4564ebef61049797c74cdf7ecdeb24f8731ca0 | 2,471 | py | Python | tests/test_marmiton.py | squat-house/recipe-scrapers | 72d2f69196f95210d2ea248f3b5cb446f94fd2b2 | [
"MIT"
] | 2 | 2020-07-28T15:12:10.000Z | 2020-07-30T18:10:33.000Z | tests/test_marmiton.py | bfcarpio/recipe-scrapers | 827ec444bc9d422a98c84c05cc4e4bcd3d084d51 | [
"MIT"
] | 1 | 2022-01-08T10:49:17.000Z | 2022-01-08T10:49:30.000Z | tests/test_marmiton.py | AlexRogalskiy/recipe-scrapers | ff378b3ba4ae7ff4cbc113ca13991f887c1c70e7 | [
"MIT"
] | 1 | 2022-01-08T10:49:09.000Z | 2022-01-08T10:49:09.000Z | from recipe_scrapers.marmiton import Marmiton
from tests import ScraperTest
class TestMarmitonScraper(ScraperTest):
scraper_class = Marmiton
def test_host(self):
self.assertEqual("marmiton.org", self.harvester_class.host())
def test_canonical_url(self):
self.assertEqual(
"ht... | 38.015385 | 114 | 0.607446 | from recipe_scrapers.marmiton import Marmiton
from tests import ScraperTest
class TestMarmitonScraper(ScraperTest):
scraper_class = Marmiton
def test_host(self):
self.assertEqual("marmiton.org", self.harvester_class.host())
def test_canonical_url(self):
self.assertEqual(
"ht... | true | true |
1c4564ec45018750930b24c198003bce822d9fed | 2,333 | py | Python | script.py | jornix/Stavanger-school-learning-results | 9974cac4ebb91ea51b0437f8b7750feac3049804 | [
"MIT"
] | null | null | null | script.py | jornix/Stavanger-school-learning-results | 9974cac4ebb91ea51b0437f8b7750feac3049804 | [
"MIT"
] | null | null | null | script.py | jornix/Stavanger-school-learning-results | 9974cac4ebb91ea51b0437f8b7750feac3049804 | [
"MIT"
] | null | null | null | import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
# Read csv and store in dataframe df
df = pd.read_csv("results.csv")
df.drop(["index"], axis=1).reset_index(drop=True)
# Separate fifth grade tests
femte_trinn = df[
(df["statistikk"] == "Nasjonale prøver 5. trinn") & (pd.isna(df["ver... | 29.910256 | 87 | 0.717531 | import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
df = pd.read_csv("results.csv")
df.drop(["index"], axis=1).reset_index(drop=True)
femte_trinn = df[
(df["statistikk"] == "Nasjonale prøver 5. trinn") & (pd.isna(df["verdi"]) == False)
].reset_index(drop=True)
femte_trinn_engelsk =... | true | true |
1c4565b7ff36d1855854ec42200d3c17a32a5c55 | 1,561 | py | Python | apps/wagtail/myblog/migrations/0002_auto_20210425_1951.py | aadrm/breakoutwagtail | cf4ce09153adf2b5e14f15ffbc82bda754d427b3 | [
"MIT"
] | null | null | null | apps/wagtail/myblog/migrations/0002_auto_20210425_1951.py | aadrm/breakoutwagtail | cf4ce09153adf2b5e14f15ffbc82bda754d427b3 | [
"MIT"
] | null | null | null | apps/wagtail/myblog/migrations/0002_auto_20210425_1951.py | aadrm/breakoutwagtail | cf4ce09153adf2b5e14f15ffbc82bda754d427b3 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-04-25 19:51
import apps.wagtail.streams.blocks
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
('myblog', '0001_initial'),
]
operations... | 55.75 | 511 | 0.695708 |
import apps.wagtail.streams.blocks
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
('myblog', '0001_initial'),
]
operations = [
migrations.AddField(
m... | true | true |
1c4565b95bce497665b69de99a26e49f66b582e5 | 416 | py | Python | simple-backend/stave_backend/migrations/0002_document_ontology.py | mylibrar/stave | 43145015253d0577dfc757419ad8b4fa06a04042 | [
"Apache-2.0"
] | 35 | 2020-01-29T04:21:10.000Z | 2021-12-13T01:44:28.000Z | simple-backend/stave_backend/migrations/0002_document_ontology.py | mylibrar/stave | 43145015253d0577dfc757419ad8b4fa06a04042 | [
"Apache-2.0"
] | 86 | 2020-04-17T16:36:13.000Z | 2022-03-25T22:51:34.000Z | simple-backend/stave_backend/migrations/0002_document_ontology.py | mylibrar/stave | 43145015253d0577dfc757419ad8b4fa06a04042 | [
"Apache-2.0"
] | 18 | 2020-02-04T17:40:02.000Z | 2021-06-17T07:11:42.000Z | # Generated by Django 3.0.2 on 2020-01-13 18:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stave_backend', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='document',
name='ontology',
... | 20.8 | 47 | 0.586538 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stave_backend', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='document',
name='ontology',
field=models.TextField(default=''),
... | true | true |
1c4565d7e382b201d1238aef00abd33b71ffbf9f | 3,402 | py | Python | src/tests/config_test.py | dixonwhitmire/lib-kafka | a29ec606278ad1ed8c5ada418e45593fe71dbaec | [
"Apache-2.0"
] | null | null | null | src/tests/config_test.py | dixonwhitmire/lib-kafka | a29ec606278ad1ed8c5ada418e45593fe71dbaec | [
"Apache-2.0"
] | 6 | 2021-11-03T15:17:29.000Z | 2021-11-05T14:10:56.000Z | src/tests/config_test.py | dixonwhitmire/lib-kafka | a29ec606278ad1ed8c5ada418e45593fe71dbaec | [
"Apache-2.0"
] | 1 | 2021-11-01T12:21:11.000Z | 2021-11-01T12:21:11.000Z | import os
import pytest
from pydantic import ValidationError
from lib_kafka import config as configuration
import importlib
from tests import resources_directory
@pytest.fixture(autouse=True)
def reset():
reset_env_vars()
def reset_env_vars():
for env_var in ("KAFKA_BROKER_CONFIG_FILE", "KAFKA_TOPIC_CONFIG_... | 32.4 | 113 | 0.683422 | import os
import pytest
from pydantic import ValidationError
from lib_kafka import config as configuration
import importlib
from tests import resources_directory
@pytest.fixture(autouse=True)
def reset():
reset_env_vars()
def reset_env_vars():
for env_var in ("KAFKA_BROKER_CONFIG_FILE", "KAFKA_TOPIC_CONFIG_... | true | true |
1c4565e0dbfa4053de453a8497b1789732532024 | 1,386 | py | Python | beorn_lib/version.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | beorn_lib/version.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | beorn_lib/version.py | PAntoine/beorn_lib | a5bb8859acfb136f33559b6ddbf3bb20f61bd310 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------------
#
# ,--.
# | |-. ,---. ,---. ,--.--.,--,--,
# | .-. '| .-. :| .-. || .--'| \
# | `-' |\ --.' '-' '| | ... | 37.459459 | 82 | 0.328283 |
# `---' `----' `---' `--' `--''--'
__author__ = "Peter Antoine"
__copyright__ = "Copyright 2014-2021, Peter Antoine"
__credits__ = ["Peter Antoine"]
__license__ = "MIT"
__version__ = "1.5.0"
__maintainer__ = "Peter Antoine"
__email__ = "github@peterantoine.me.uk"
__url... | true | true |
1c456664268f1c7c8973969844fb625e7b99c69c | 6,122 | py | Python | dmwmclient/restclient.py | FernandoGarzon/dmwmclient | aa69978b430f6626864718ddfa21951f2bb41d06 | [
"BSD-3-Clause"
] | 1 | 2022-02-01T16:06:15.000Z | 2022-02-01T16:06:15.000Z | dmwmclient/restclient.py | FernandoGarzon/dmwmclient | aa69978b430f6626864718ddfa21951f2bb41d06 | [
"BSD-3-Clause"
] | 3 | 2020-03-04T23:34:39.000Z | 2020-04-03T22:19:44.000Z | dmwmclient/restclient.py | nsmith-/dmwmclient | 726a9400f5270e0521dc9d2c1bffed3c0af410a2 | [
"BSD-3-Clause"
] | 4 | 2020-03-17T15:39:10.000Z | 2021-06-10T22:51:11.000Z | import os
import logging
import json
import httpx
import asyncio
from lxml import etree
from . import __version__
logger = logging.getLogger(__name__)
def locate_proxycert():
"""Find a user proxy"""
path = os.getenv("X509_USER_PROXY")
if path is not None:
return path
path = "/tmp/x509up_u%d"... | 37.329268 | 90 | 0.571219 | import os
import logging
import json
import httpx
import asyncio
from lxml import etree
from . import __version__
logger = logging.getLogger(__name__)
def locate_proxycert():
path = os.getenv("X509_USER_PROXY")
if path is not None:
return path
path = "/tmp/x509up_u%d" % os.getuid()
if os.pat... | true | true |
1c4566b1e1aee1b8f0aa8bfb88df64b92879f477 | 7,636 | py | Python | sdk/python/pulumi_azure_native/network/v20180301/get_profile.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20180301/get_profile.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20180301/get_profile.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"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, overload
from ... import _utilities
fro... | 38.761421 | 225 | 0.667234 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
__all__ = [
'GetProfileResult',
'AwaitableGetProfileResult',
'get_profile',
]
@pulumi.output_type
class GetProfileResult:
def __... | true | true |
1c45678f9f69f1c3e03546028ce022e51687f2b5 | 48,532 | py | Python | hytra/core/hypothesesgraph.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | hytra/core/hypothesesgraph.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | hytra/core/hypothesesgraph.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | import logging
import copy
import networkx as nx
import numpy as np
from sklearn.neighbors import KDTree
import hytra.core.jsongraph
from hytra.core.jsongraph import negLog, listify
from hytra.util.progressbar import DefaultProgressVisitor
logger = logging.getLogger(__name__)
def getTraxelFeatureVector(traxel, feat... | 43.643885 | 166 | 0.557879 | import logging
import copy
import networkx as nx
import numpy as np
from sklearn.neighbors import KDTree
import hytra.core.jsongraph
from hytra.core.jsongraph import negLog, listify
from hytra.util.progressbar import DefaultProgressVisitor
logger = logging.getLogger(__name__)
def getTraxelFeatureVector(traxel, feat... | true | true |
1c4567adc8fd9e1e995c1211c7aa015c0a2da7ee | 4,059 | py | Python | blockchain_client.py | JB1984/TheBlock | 0e0b00034424d7453651b5efc2ef71a13f3719c4 | [
"MIT"
] | null | null | null | blockchain_client.py | JB1984/TheBlock | 0e0b00034424d7453651b5efc2ef71a13f3719c4 | [
"MIT"
] | 6 | 2018-09-14T21:00:41.000Z | 2018-09-27T11:05:52.000Z | blockchain_client.py | JB1984/TheBlock | 0e0b00034424d7453651b5efc2ef71a13f3719c4 | [
"MIT"
] | null | null | null | from collections import OrderedDict
import binascii
import base64
import json
import Crypto
import Crypto.Random
from Crypto.Hash import SHA
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
import requests
from flask import Flask, jsonify, request, render_template
class Tran... | 29.845588 | 114 | 0.649914 | from collections import OrderedDict
import binascii
import base64
import json
import Crypto
import Crypto.Random
from Crypto.Hash import SHA
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
import requests
from flask import Flask, jsonify, request, render_template
class Tran... | true | true |
1c4567eaf684081be1c5f842fe292f61cc1719a8 | 1,370 | py | Python | dataloader/dataloaders.py | misads/cv_template | 9976ee0ada449a494d26f896c598610f233edc10 | [
"MIT"
] | 69 | 2020-09-01T11:23:48.000Z | 2022-03-26T08:42:16.000Z | dataloader/dataloaders.py | misads/cv_template | 9976ee0ada449a494d26f896c598610f233edc10 | [
"MIT"
] | 3 | 2021-02-16T09:22:09.000Z | 2022-01-02T07:54:39.000Z | dataloader/dataloaders.py | misads/cv_template | 9976ee0ada449a494d26f896c598610f233edc10 | [
"MIT"
] | 15 | 2020-07-07T06:37:33.000Z | 2022-03-21T07:37:33.000Z | # encoding=utf-8
from dataloader.image_list import ListTrainValDataset, ListTestDataset
from dataloader.transforms import get_transform
from torch.utils.data import DataLoader
from options import opt
import pdb
import os
###################
TEST_DATASET_HAS_OPEN = False # 有没有开放测试集
###################
train_list = o... | 35.128205 | 126 | 0.783212 |
from dataloader.image_list import ListTrainValDataset, ListTestDataset
from dataloader.transforms import get_transform
from torch.utils.data import DataLoader
from options import opt
import pdb
import os
= ListTrainValDataset(train_list, transforms=train_transform, max_size=max_size)
train_dataloader = DataLoader(tra... | true | true |
1c45681e99e7576cdadf4d81110b8dbc5fa1dd25 | 4,730 | py | Python | graph_objs/ohlc/_line.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/ohlc/_line.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/ohlc/_line.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "ohlc"
_path_str = "ohlc.line"
_valid_props = {"dash", "width"}
# dash
# ----
@pro... | 31.324503 | 82 | 0.532981 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
_parent_path_str = "ohlc"
_path_str = "ohlc.line"
_valid_props = {"dash", "width"}
@property
def dash(self):
return self["dash"... | true | true |
1c45687ed1e1d1996e74a33c71010180e5f720d1 | 6,785 | py | Python | Localization/particle_filter/particle_filter.py | MerdanBay/PythonRobotics | 71de5d038f348d347d7b5dc00c914d523cd59f92 | [
"MIT"
] | 1 | 2021-12-02T01:45:01.000Z | 2021-12-02T01:45:01.000Z | Localization/particle_filter/particle_filter.py | MerdanBay/PythonRobotics | 71de5d038f348d347d7b5dc00c914d523cd59f92 | [
"MIT"
] | null | null | null | Localization/particle_filter/particle_filter.py | MerdanBay/PythonRobotics | 71de5d038f348d347d7b5dc00c914d523cd59f92 | [
"MIT"
] | 1 | 2022-01-14T11:11:24.000Z | 2022-01-14T11:11:24.000Z | """
Particle Filter localization sample
author: Atsushi Sakai (@Atsushi_twi)
"""
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../utils/")
import math
import matplotlib.pyplot as plt
import numpy as np
from utils.angle import rot_mat_2d
# Estimation parameter of PF
Q = np.di... | 25.700758 | 80 | 0.506853 | import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../utils/")
import math
import matplotlib.pyplot as plt
import numpy as np
from utils.angle import rot_mat_2d
Q = np.diag([0.2]) ** 2
R = np.diag([2.0, np.deg2rad(40.0)]) ** 2
Q_sim = np.diag([0.2]) ** 2
R_sim = np.diag([1.0,... | true | true |
1c45694042710f3d8d3724815e70347ae2585bff | 1,850 | py | Python | thedoctor/tests/test_integration.py | hhuuggoo/thedoctor | 84c11377dc16ef8208480cd2745ce1ffc5614865 | [
"BSD-2-Clause"
] | 37 | 2015-02-24T21:59:04.000Z | 2021-07-13T19:04:34.000Z | thedoctor/tests/test_integration.py | hhuuggoo/thedoctor | 84c11377dc16ef8208480cd2745ce1ffc5614865 | [
"BSD-2-Clause"
] | 1 | 2015-03-23T20:23:41.000Z | 2015-03-23T21:09:58.000Z | thedoctor/tests/test_integration.py | hhuuggoo/thedoctor | 84c11377dc16ef8208480cd2745ce1ffc5614865 | [
"BSD-2-Clause"
] | 7 | 2015-03-17T17:18:27.000Z | 2020-07-30T13:05:42.000Z | from .utils import raises
from .. import ValidationError
from .. import validate
from ..validators import dict_validator, true
def test_integration():
@validate(a=int, b=int)
def func(a, b):
return (a, b)
assert func(1, 2) == (1, 2)
assert raises(ValidationError, func, 1, 'a')
@validate(a... | 26.428571 | 76 | 0.584324 | from .utils import raises
from .. import ValidationError
from .. import validate
from ..validators import dict_validator, true
def test_integration():
@validate(a=int, b=int)
def func(a, b):
return (a, b)
assert func(1, 2) == (1, 2)
assert raises(ValidationError, func, 1, 'a')
@validate(a... | true | true |
1c45697bb34e4558711a296700d158a28ef349c2 | 1,054 | py | Python | onnxruntime/__init__.py | NonStatic2014/onnxruntime | bdfd46082a152e9605199b4f01664fc76f97a346 | [
"MIT"
] | null | null | null | onnxruntime/__init__.py | NonStatic2014/onnxruntime | bdfd46082a152e9605199b4f01664fc76f97a346 | [
"MIT"
] | 10 | 2019-03-25T21:47:46.000Z | 2019-04-30T02:33:05.000Z | onnxruntime/__init__.py | NonStatic2014/onnxruntime | bdfd46082a152e9605199b4f01664fc76f97a346 | [
"MIT"
] | 1 | 2019-04-09T16:15:51.000Z | 2019-04-09T16:15:51.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
"""
ONNX Runtime
enables high-performance evaluation of trained machine l... | 47.909091 | 217 | 0.701139 |
__version__ = "0.5.0"
__author__ = "Microsoft"
from onnxruntime.capi._pybind_state import get_all_providers, get_available_providers, get_device, RunOptions, SessionOptions, set_default_logger_severity, NodeArg, ModelMetadata, GraphOptimizationLevel, ExecutionMode
from onnxruntime.capi.session import InferenceSess... | true | true |
1c4569ce9ebd3c7cda1043c0df205b8a956f5f5e | 3,842 | py | Python | image_train.py | to0mi1/image-categorization-based-cifar10 | 96218f2f60faf424b26112559a170a05463113bb | [
"MIT"
] | 1 | 2019-04-16T08:42:32.000Z | 2019-04-16T08:42:32.000Z | image_train.py | to0mi1/image-categorization-based-cifar10 | 96218f2f60faf424b26112559a170a05463113bb | [
"MIT"
] | null | null | null | image_train.py | to0mi1/image-categorization-based-cifar10 | 96218f2f60faf424b26112559a170a05463113bb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
モデルを作成しトレーニングを行う
"""
import os
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Dense, Dropout, Activation, Flatten
from keras.utils import plot_model
from keras.preprocessing.image import ImageDataGenerator
from keras.utils import plot_model
from keras.pre... | 30.736 | 107 | 0.656689 |
import os
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Dense, Dropout, Activation, Flatten
from keras.utils import plot_model
from keras.preprocessing.image import ImageDataGenerator
from keras.utils import plot_model
from keras.preprocessing import image
from keras.callbacks imp... | true | true |
1c456a5b82ba05659c5a11cb9ea95320d3f81903 | 2,818 | py | Python | test/functional/rpc_getblockfilter.py | CallMeMisterOwl/bitcoin | 9d2895157ec0ff6e356f40c5fe84d3007fc991c1 | [
"MIT"
] | 2 | 2020-08-16T16:27:01.000Z | 2020-08-20T06:19:32.000Z | test/functional/rpc_getblockfilter.py | CallMeMisterOwl/bitcoin | 9d2895157ec0ff6e356f40c5fe84d3007fc991c1 | [
"MIT"
] | 1 | 2022-01-08T14:38:57.000Z | 2022-01-08T14:38:57.000Z | test/functional/rpc_getblockfilter.py | CallMeMisterOwl/bitcoin | 9d2895157ec0ff6e356f40c5fe84d3007fc991c1 | [
"MIT"
] | 1 | 2022-02-19T19:33:46.000Z | 2022-02-19T19:33:46.000Z | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the getblockfilter RPC."""
from test_framework.test_framework import BitcoinTestFramework
from te... | 43.353846 | 112 | 0.688077 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal, assert_is_hex_string, assert_raises_rpc_error,
)
FILTER_TYPES = ["basic"]
class GetBlockFilterTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
... | true | true |
1c456aa4cb7c1dda13e25217b75d8708106ea6d2 | 14,192 | py | Python | sdk/python/pulumi_azure_nextgen/securityinsights/v20190101preview/get_incident.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/securityinsights/v20190101preview/get_incident.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/securityinsights/v20190101preview/get_incident.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # 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... | 39.532033 | 483 | 0.666995 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetIncidentResult',
'AwaitableGetIncidentResult',
'get_incident',
]
@pulumi.output_type
class GetIncidentResult:
def... | true | true |
1c456b4651c14bf62f1b981a4373ef3876f9cc4a | 10,375 | py | Python | python/tvm/relay/analysis.py | Checkmate50/tvm | 0293f42232ac2506c9cf8914410282c54ee4c0ed | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/analysis.py | Checkmate50/tvm | 0293f42232ac2506c9cf8914410282c54ee4c0ed | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/analysis.py | Checkmate50/tvm | 0293f42232ac2506c9cf8914410282c54ee4c0ed | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 24.585308 | 95 | 0.64212 |
from . import _analysis
from . import _make
from .expr import Expr
from .ty import Type
from .module import Module
from .feature import Feature
def post_order_visit(expr, fvisit):
return _analysis.post_order_visit(expr, fvisit)
def well_formed(expr):
return _analysis.well_formed(expr)
de... | true | true |
1c456c74c2cf7a473b376d5f287a9bb1a2b9f3b9 | 5,363 | py | Python | netbox/utilities/forms/widgets.py | letic/netbox | 0930745e16330edf00da081150b079d5ed6ecc02 | [
"Apache-2.0"
] | 2 | 2021-07-08T03:58:12.000Z | 2022-02-11T21:50:46.000Z | netbox/utilities/forms/widgets.py | letic/netbox | 0930745e16330edf00da081150b079d5ed6ecc02 | [
"Apache-2.0"
] | 25 | 2019-09-17T19:40:50.000Z | 2022-03-11T04:01:55.000Z | netbox/utilities/forms/widgets.py | letic/netbox | 0930745e16330edf00da081150b079d5ed6ecc02 | [
"Apache-2.0"
] | 1 | 2022-02-11T21:50:58.000Z | 2022-02-11T21:50:58.000Z | import json
from django import forms
from django.conf import settings
from django.contrib.postgres.forms import SimpleArrayField
from utilities.choices import ColorChoices
from .utils import add_blank_choice, parse_numeric_range
__all__ = (
'APISelect',
'APISelectMultiple',
'BulkEditNullBooleanSelect',
... | 28.078534 | 120 | 0.641618 | import json
from django import forms
from django.conf import settings
from django.contrib.postgres.forms import SimpleArrayField
from utilities.choices import ColorChoices
from .utils import add_blank_choice, parse_numeric_range
__all__ = (
'APISelect',
'APISelectMultiple',
'BulkEditNullBooleanSelect',
... | true | true |
1c456cd394ed39fe157a450029b8b5c2dcc40bd1 | 598 | py | Python | src/modax/training/.ipynb_checkpoints/utils-checkpoint.py | GJBoth/modax | c7e1c128d4dd48b776f8ec4fa724c2e4b6e13c82 | [
"MIT"
] | 2 | 2021-12-10T14:36:37.000Z | 2022-02-10T11:47:03.000Z | src/modax/training/.ipynb_checkpoints/utils-checkpoint.py | GJBoth/modax | c7e1c128d4dd48b776f8ec4fa724c2e4b6e13c82 | [
"MIT"
] | null | null | null | src/modax/training/.ipynb_checkpoints/utils-checkpoint.py | GJBoth/modax | c7e1c128d4dd48b776f8ec4fa724c2e4b6e13c82 | [
"MIT"
] | 2 | 2020-12-22T14:49:13.000Z | 2021-04-09T08:52:08.000Z | from jax import jit, value_and_grad
from functools import partial
import jax.profiler
def create_update(loss_fn, loss_fn_args):
def step(opt, state, loss_fn, loss_fn_args):
grad_fn = value_and_grad(loss_fn, argnums=0, has_aux=True)
(loss, (updated_state, metrics, output)), grad = grad_fn(
... | 35.176471 | 73 | 0.704013 | from jax import jit, value_and_grad
from functools import partial
import jax.profiler
def create_update(loss_fn, loss_fn_args):
def step(opt, state, loss_fn, loss_fn_args):
grad_fn = value_and_grad(loss_fn, argnums=0, has_aux=True)
(loss, (updated_state, metrics, output)), grad = grad_fn(
... | true | true |
1c456f4aeae0fd4829f9f0818a661eb6433b1c8e | 399 | py | Python | tests/multidl/downloaders/test_local_file_downloader.py | gazay/chiliad | 771b3d0f7004f2a03094bad7bcc0103715a6c73f | [
"MIT"
] | 16 | 2018-02-12T23:47:26.000Z | 2021-07-23T12:43:05.000Z | tests/multidl/downloaders/test_local_file_downloader.py | gazay/chiliad | 771b3d0f7004f2a03094bad7bcc0103715a6c73f | [
"MIT"
] | 6 | 2017-10-14T15:36:52.000Z | 2022-02-13T17:17:17.000Z | tests/multidl/downloaders/test_local_file_downloader.py | gazay/chiliad | 771b3d0f7004f2a03094bad7bcc0103715a6c73f | [
"MIT"
] | 6 | 2018-05-11T00:16:00.000Z | 2021-05-03T02:02:55.000Z | # -*- coding: utf-8 -*-
import pytest
from multidl.downloaders.local_file_downloader import LocalFileDownloader
@pytest.mark.parametrize('url, expected', [
('file:///dir/file1.txt', 'file1.txt'),
('file:///file2.txt', 'file2.txt'),
])
def test_get_file_name(tmpdir, url, expected):
downloader = LocalFile... | 26.6 | 73 | 0.704261 |
import pytest
from multidl.downloaders.local_file_downloader import LocalFileDownloader
@pytest.mark.parametrize('url, expected', [
('file:///dir/file1.txt', 'file1.txt'),
('file:///file2.txt', 'file2.txt'),
])
def test_get_file_name(tmpdir, url, expected):
downloader = LocalFileDownloader(url, str(tmp... | true | true |
1c456f6f57902768c2181ef37ffa76b83cb79aad | 2,283 | py | Python | src/demo/worker_flags.py | Ravi-0809/question-generation | 9065a3b47293b8a69a0548af1f6bedd4a4aa7f9c | [
"MIT"
] | 212 | 2018-08-15T11:06:35.000Z | 2021-11-21T10:21:55.000Z | src/demo/worker_flags.py | Ravi-0809/question-generation | 9065a3b47293b8a69a0548af1f6bedd4a4aa7f9c | [
"MIT"
] | 44 | 2018-10-15T12:50:31.000Z | 2020-11-13T18:02:03.000Z | src/demo/worker_flags.py | Ravi-0809/question-generation | 9065a3b47293b8a69a0548af1f6bedd4a4aa7f9c | [
"MIT"
] | 51 | 2018-08-17T18:17:43.000Z | 2021-03-04T06:14:52.000Z | class FlagsObject(object):
pass
FLAGS = FlagsObject()
# config
FLAGS.testing = False
FLAGS.model_type = 'RL-S2S'
FLAGS.restore = False
FLAGS.restore_path = None
FLAGS.policy_gradient = False
FLAGS.glove_vocab = False
FLAGS.embedding_loss = False
FLAGS.latent_switch = False
FLAGS.combine_vocab = False
FLAGS.l... | 19.852174 | 41 | 0.782742 | class FlagsObject(object):
pass
FLAGS = FlagsObject()
FLAGS.testing = False
FLAGS.model_type = 'RL-S2S'
FLAGS.restore = False
FLAGS.restore_path = None
FLAGS.policy_gradient = False
FLAGS.glove_vocab = False
FLAGS.embedding_loss = False
FLAGS.latent_switch = False
FLAGS.combine_vocab = False
FLAGS.lr_schedu... | true | true |
1c4572039e05249fc64e7f7a9e3e39836024d635 | 9,745 | py | Python | theseus/geometry/so2.py | jeffin07/theseus | 3498bbddf9cca740c2703d0c1aa3a78a7264cb15 | [
"MIT"
] | 236 | 2021-12-03T15:59:29.000Z | 2022-03-30T23:18:33.000Z | theseus/geometry/so2.py | jeffin07/theseus | 3498bbddf9cca740c2703d0c1aa3a78a7264cb15 | [
"MIT"
] | 85 | 2021-12-06T07:04:11.000Z | 2022-03-31T20:29:26.000Z | theseus/geometry/so2.py | jeffin07/theseus | 3498bbddf9cca740c2703d0c1aa3a78a7264cb15 | [
"MIT"
] | 12 | 2021-12-03T22:02:44.000Z | 2022-03-20T14:58:27.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List, Optional, Tuple, Union, cast
import torch
import theseus.constants
from .lie_group import LieGroup
from .point_t... | 33.719723 | 88 | 0.548794 |
from typing import List, Optional, Tuple, Union, cast
import torch
import theseus.constants
from .lie_group import LieGroup
from .point_types import Point2
class SO2(LieGroup):
def __init__(
self,
theta: Optional[torch.Tensor] = None,
data: Optional[torch.Tensor] = None,
na... | true | true |
1c457240e1e5b43e46789912d1b54ae8e79edea8 | 1,095 | py | Python | clients/python-blueplanet/generated/app/openapi_server/test/test_pal_park_area_controller.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | clients/python-blueplanet/generated/app/openapi_server/test/test_pal_park_area_controller.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | clients/python-blueplanet/generated/app/openapi_server/test/test_pal_park_area_controller.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
from openapi_server.test import BaseTestCase
class TestPalParkAreaController(BaseTestCase):
"""PalParkAreaController integration test stubs"""
def test_pal_park_area_list(self):
"""Test case for p... | 25.465116 | 77 | 0.584475 |
from __future__ import absolute_import
from flask import json
from six import BytesIO
from openapi_server.test import BaseTestCase
class TestPalParkAreaController(BaseTestCase):
def test_pal_park_area_list(self):
query_string = [('limit', 56),
('offset', 56)]
response ... | true | true |
1c4572b3f0877f03e9b3d4dda6b4a194a5df981e | 8,142 | py | Python | src/onelogin/saml2/logout_response.py | lmegviar/python-saml | 1d15da53470414f4c35e97730be6a2836d9244c5 | [
"BSD-3-Clause"
] | null | null | null | src/onelogin/saml2/logout_response.py | lmegviar/python-saml | 1d15da53470414f4c35e97730be6a2836d9244c5 | [
"BSD-3-Clause"
] | null | null | null | src/onelogin/saml2/logout_response.py | lmegviar/python-saml | 1d15da53470414f4c35e97730be6a2836d9244c5 | [
"BSD-3-Clause"
] | 1 | 2019-06-26T18:50:14.000Z | 2019-06-26T18:50:14.000Z | # -*- coding: utf-8 -*-
""" OneLogin_Saml2_Logout_Response class
Copyright (c) 2014, OneLogin, Inc.
All rights reserved.
Logout Response class of OneLogin's Python Toolkit.
"""
from base64 import b64decode
from defusedxml.lxml import fromstring
from urllib import quote_plus
from xml.dom.minidom import Document
fr... | 39.333333 | 181 | 0.607836 |
""" OneLogin_Saml2_Logout_Response class
Copyright (c) 2014, OneLogin, Inc.
All rights reserved.
Logout Response class of OneLogin's Python Toolkit.
"""
from base64 import b64decode
from defusedxml.lxml import fromstring
from urllib import quote_plus
from xml.dom.minidom import Document
from defusedxml.minidom i... | false | true |
1c45730c64130865dfab642c09670520f0db3188 | 5,508 | py | Python | gammagl/layers/conv/hetero_wrapper.py | BUPT-GAMMA/GammaGL | 2b9f32e1ac3533cb75a063243e8a2fa654466d18 | [
"Apache-2.0"
] | null | null | null | gammagl/layers/conv/hetero_wrapper.py | BUPT-GAMMA/GammaGL | 2b9f32e1ac3533cb75a063243e8a2fa654466d18 | [
"Apache-2.0"
] | null | null | null | gammagl/layers/conv/hetero_wrapper.py | BUPT-GAMMA/GammaGL | 2b9f32e1ac3533cb75a063243e8a2fa654466d18 | [
"Apache-2.0"
] | null | null | null | import tensorlayerx as tlx
import gammagl.mpops as mpops
import warnings
from collections import defaultdict
from typing import Dict, Optional
def group(xs, aggr):
if len(xs) == 0:
return None
elif aggr is None:
return tlx.stack(xs, axis=1)
elif len(xs) == 1:
return xs[0]
else:
... | 37.469388 | 79 | 0.564089 | import tensorlayerx as tlx
import gammagl.mpops as mpops
import warnings
from collections import defaultdict
from typing import Dict, Optional
def group(xs, aggr):
if len(xs) == 0:
return None
elif aggr is None:
return tlx.stack(xs, axis=1)
elif len(xs) == 1:
return xs[0]
else:
... | true | true |
1c45736df60cd6ec7b8c468f4bdacbfcf5d93fef | 10,202 | py | Python | 9_export_fbx_bitbucket_stable/fbx_deformer.py | makehumancommunity/community-plugins-fbx | 1f78be1723063cee0ae83232587431ab0f2e9894 | [
"MIT"
] | 1 | 2020-04-17T16:32:06.000Z | 2020-04-17T16:32:06.000Z | 9_export_fbx_bitbucket_stable/fbx_deformer.py | makehumancommunity/community-plugins-fbx | 1f78be1723063cee0ae83232587431ab0f2e9894 | [
"MIT"
] | null | null | null | 9_export_fbx_bitbucket_stable/fbx_deformer.py | makehumancommunity/community-plugins-fbx | 1f78be1723063cee0ae83232587431ab0f2e9894 | [
"MIT"
] | 5 | 2019-06-01T07:04:17.000Z | 2022-02-21T14:14:51.000Z | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
"""
**Project Name:** MakeHuman
**Product Home Page:** http://www.makehuman.org/
**Code Home Page:** https://bitbucket.org/MakeHuman/makehuman/
**Authors:** Thomas Larsson, Jonas Hauquier
**Copyright(c):** MakeHuman Team 2001-2017
**Licensing:** ... | 29.917889 | 96 | 0.525387 |
import transformations as tm
from .fbx_utils import *
def getObjectCounts(meshes):
nVertexGroups = 0
for mesh in meshes:
if mesh.vertexWeights is None:
continue
for weights in mesh.vertexWeights.data:
if weights:
nVertexGroups += 1
nShapes =... | true | true |
1c4573e4d03b690f34aa54ed5a53a2890c2dddaf | 1,030 | py | Python | src/data/425.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | src/data/425.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | src/data/425.py | NULLCT/LOMC | 79a16474a8f21310e0fb47e536d527dd5dc6d655 | [
"MIT"
] | null | null | null | import sys
def main():
sys.setrecursionlimit(1000000)
N, Q = [int(x) for x in input().split()]
# 隣接リスト形式でグラフをつくる
# 重み付きの場合は、[行き先, weight]をそれぞれの行に持たせれば良い。
graph = [[] for i in range(N)]
for i in range(N - 1):
a, b = [int(x) for x in input().split()]
graph[a - 1].append(b - 1)
... | 23.953488 | 64 | 0.551456 | import sys
def main():
sys.setrecursionlimit(1000000)
N, Q = [int(x) for x in input().split()]
graph = [[] for i in range(N)]
for i in range(N - 1):
a, b = [int(x) for x in input().split()]
graph[a - 1].append(b - 1)
graph[b - 1].append(a - 1)
queries = []
... | true | true |
1c4574061d4be29467fa53f9afe975e345de3bfa | 3,268 | py | Python | pyInstaller/dash/dash/resources.py | rianawillers/dash-lineplot | b72c3e4799d39bdc33bbcae2202fdefd6f4af00e | [
"MIT"
] | 2 | 2021-09-17T14:23:28.000Z | 2021-09-17T22:12:50.000Z | pyInstaller/dash/dash/resources.py | rianawillers/dash-lineplot | b72c3e4799d39bdc33bbcae2202fdefd6f4af00e | [
"MIT"
] | null | null | null | pyInstaller/dash/dash/resources.py | rianawillers/dash-lineplot | b72c3e4799d39bdc33bbcae2202fdefd6f4af00e | [
"MIT"
] | 17 | 2019-11-21T14:11:29.000Z | 2019-11-21T15:26:23.000Z | import json
import warnings
import os
from .development.base_component import ComponentRegistry
from . import exceptions
class Resources:
def __init__(self, resource_name):
self._resources = []
self.resource_name = resource_name
def append_resource(self, resource):
self._resources.ap... | 34.041667 | 75 | 0.604651 | import json
import warnings
import os
from .development.base_component import ComponentRegistry
from . import exceptions
class Resources:
def __init__(self, resource_name):
self._resources = []
self.resource_name = resource_name
def append_resource(self, resource):
self._resources.ap... | true | true |
1c45743ca4e65273720ebd7ad9326b42e0788bfd | 1,734 | py | Python | mergesort.py | maurendeviia/pythoncharmers | b5775d0f51a6f2e5dc0365345e0436dea4c72c14 | [
"MIT"
] | 37 | 2020-10-01T15:20:12.000Z | 2021-10-04T14:17:06.000Z | mergesort.py | maurendeviia/pythoncharmers | b5775d0f51a6f2e5dc0365345e0436dea4c72c14 | [
"MIT"
] | 27 | 2020-10-01T12:32:41.000Z | 2021-10-04T11:05:34.000Z | mergesort.py | maurendeviia/pythoncharmers | b5775d0f51a6f2e5dc0365345e0436dea4c72c14 | [
"MIT"
] | 57 | 2020-10-01T11:24:26.000Z | 2022-02-16T05:09:50.000Z | # Python program for implementation of MergeSort
# Merges two subarrays of arr[].
# First subarray is arr[l..m]
# Second subarray is arr[m+1..r]
def merge(arr, l, m, r):
n1 = m - l + 1
n2 = r- m
# create temp arrays
L = [0] * (n1)
R = [0] * (n2)
# Copy data to temp arrays L[] a... | 23.12 | 52 | 0.474625 |
def merge(arr, l, m, r):
n1 = m - l + 1
n2 = r- m
L = [0] * (n1)
R = [0] * (n2)
for i in range(0 , n1):
L[i] = arr[l + i]
for j in range(0 , n2):
R[j] = arr[m + 1 + j]
i = 0
j = 0
k = l
while i < n1 and j... | true | true |
1c4574486b85926786807ba74806c14f69cb0642 | 716 | py | Python | test/ie.py | napoler/Terry-toolkit | 8b1a607fb6d27801b0441b67f7eb0962794a728a | [
"MIT"
] | null | null | null | test/ie.py | napoler/Terry-toolkit | 8b1a607fb6d27801b0441b67f7eb0962794a728a | [
"MIT"
] | 14 | 2019-11-15T14:28:22.000Z | 2022-02-10T00:24:28.000Z | test/ie.py | napoler/Terry-toolkit | 8b1a607fb6d27801b0441b67f7eb0962794a728a | [
"MIT"
] | 1 | 2020-04-15T12:58:00.000Z | 2020-04-15T12:58:00.000Z | #encoding=utf-8
from __future__ import unicode_literals
import sys
sys.path.append("../")
import Terry_toolkit as tkit
t= tkit.Text()
text="""
柯基犬是个十足的小狗子
"""
# li = t.summary(text=text)
# print(li)
# li = t.get_keyphrases(text=text)
# print(li)
# li = t.sentence_segmentation(text=text)
# print(li)
# li = t.part... | 16.272727 | 70 | 0.666201 |
from __future__ import unicode_literals
import sys
sys.path.append("../")
import Terry_toolkit as tkit
t= tkit.Text()
text="""
柯基犬是个十足的小狗子
"""
ie=tkit.TripleIE(model_path='/mnt/data/dev/model/ltp/ltp_data_v3.4.0')
s=ie.get(text)
for item in s:
if item==None:
pass
else:
print... | true | true |
1c45754bd696bde5b9f6046fcb305c9e2b18fb6e | 8,617 | py | Python | make_knockoffs.py | wfbradley/snpko | abc77349d702915519518eacdf919f06579413d0 | [
"MIT"
] | null | null | null | make_knockoffs.py | wfbradley/snpko | abc77349d702915519518eacdf919f06579413d0 | [
"MIT"
] | null | null | null | make_knockoffs.py | wfbradley/snpko | abc77349d702915519518eacdf919f06579413d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import pandas as pd
import os
import numpy as np
import SNPknock.fastphase as fp
from SNPknock import knockoffHMM
from joblib import Parallel, delayed
import utils_snpko as utils
logger = utils.logger
def make_knockoff(chromosome=None, grouped_by_chromosome=None, df_SNP=None,
... | 40.455399 | 101 | 0.646049 |
import pandas as pd
import os
import numpy as np
import SNPknock.fastphase as fp
from SNPknock import knockoffHMM
from joblib import Parallel, delayed
import utils_snpko as utils
logger = utils.logger
def make_knockoff(chromosome=None, grouped_by_chromosome=None, df_SNP=None,
df_geno_experiment=... | true | true |
1c45754f10176c7ca4335379fbf3a06ceffc08ee | 13,895 | py | Python | robots/login.py | sicekit/sicekit | 30d6b665ed083893792579f6640c897e932b4ff0 | [
"MIT"
] | 11 | 2015-04-13T15:40:00.000Z | 2021-11-09T14:55:25.000Z | robots/login.py | sicekit/sicekit | 30d6b665ed083893792579f6640c897e932b4ff0 | [
"MIT"
] | null | null | null | robots/login.py | sicekit/sicekit | 30d6b665ed083893792579f6640c897e932b4ff0 | [
"MIT"
] | 4 | 2016-06-07T06:39:39.000Z | 2019-05-11T09:34:20.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to log the robot in to a wiki account.
Suggestion is to make a special account to use for robot use only. Make
sure this robot account is well known on your home wikipedia before using.
Parameters:
-all Try to log in on all sites where a username is d... | 42.362805 | 310 | 0.580784 |
__version__='$Id: login.py 7034 2009-07-09 10:11:29Z alexsh $'
import re
import urllib2
import wikipedia, config
botList = {
'wikipedia': {
'en': u'Wikipedia:Registered bots',
# Disabled because they are now using a template system which
# we can't check with our current code.
... | true | true |
1c4576baa0e49856245c1d52cad14c426975599c | 15,984 | py | Python | tfx/orchestration/metadata_test.py | romiosarkar6991/tfx-romio | 0703c1dd037c676e1d438c2e5ce831decfc9eed9 | [
"Apache-2.0"
] | 1 | 2019-10-10T06:06:12.000Z | 2019-10-10T06:06:12.000Z | tfx/orchestration/metadata_test.py | romiosarkar6991/tfx-romio | 0703c1dd037c676e1d438c2e5ce831decfc9eed9 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/metadata_test.py | romiosarkar6991/tfx-romio | 0703c1dd037c676e1d438c2e5ce831decfc9eed9 | [
"Apache-2.0"
] | 1 | 2019-10-06T03:39:58.000Z | 2019-10-06T03:39:58.000Z | # Copyright 2019 Google LLC. 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 applicable law or a... | 35.52 | 80 | 0.635385 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import mock
import tensorflow as tf
from ml_metadata.proto import metadata_store_pb2
from tfx import types
from tfx.orchestration import data_types
from tfx.orchestration import metadata
from tfx... | true | true |
1c4576f26d0bd1dafc5d7d1a3c7a8a3a5b06fec8 | 2,734 | py | Python | unsupNFP/train.py | pfnet-research/hierarchical-molecular-learning | 2c88a4737c9268e691e97d92bf2e9e2c7e2c1790 | [
"MIT"
] | 13 | 2018-06-20T11:16:27.000Z | 2020-06-23T18:56:20.000Z | unsupNFP/train.py | pfnet-research/hierarchical-molecular-learning | 2c88a4737c9268e691e97d92bf2e9e2c7e2c1790 | [
"MIT"
] | null | null | null | unsupNFP/train.py | pfnet-research/hierarchical-molecular-learning | 2c88a4737c9268e691e97d92bf2e9e2c7e2c1790 | [
"MIT"
] | 4 | 2019-09-14T23:53:44.000Z | 2021-12-09T23:36:27.000Z | import argparse
from chainer import optimizers
from chainer import serializers
import numpy as np
import model
import load_mutag
import load_nci1
import classification
n_epoch = 200
n_parts = 5
parser = argparse.ArgumentParser()
parser.add_argument('dataset', type=str, choices=('mutag', 'ptc'))
args = parser.parse... | 29.717391 | 73 | 0.685077 | import argparse
from chainer import optimizers
from chainer import serializers
import numpy as np
import model
import load_mutag
import load_nci1
import classification
n_epoch = 200
n_parts = 5
parser = argparse.ArgumentParser()
parser.add_argument('dataset', type=str, choices=('mutag', 'ptc'))
args = parser.parse... | true | true |
1c457730cf5448e958549f79c322f8bde85c2542 | 13,955 | py | Python | stumpy/aamp_ostinato.py | alvii147/stumpy | 6dacfcf35ce03255951d70e5dd2f8b3f4e20a27f | [
"BSD-3-Clause"
] | 2 | 2022-01-25T22:38:56.000Z | 2022-01-31T10:59:02.000Z | stumpy/aamp_ostinato.py | vishalbelsare/stumpy | 5f192a0a41fbb44f144cc4b676d525f19aaeaa98 | [
"BSD-3-Clause"
] | null | null | null | stumpy/aamp_ostinato.py | vishalbelsare/stumpy | 5f192a0a41fbb44f144cc4b676d525f19aaeaa98 | [
"BSD-3-Clause"
] | null | null | null | # STUMPY
# Copyright 2019 TD Ameritrade. Released under the terms of the 3-Clause BSD license.
# STUMPY is a trademark of TD Ameritrade IP Company, Inc. All rights reserved.
import numpy as np
from . import core, aamp, aamped
def _aamp_across_series_nearest_neighbors(
Ts, Ts_idx, subseq_idx, m, Ts_squared, Ts_s... | 35.874036 | 88 | 0.668649 |
import numpy as np
from . import core, aamp, aamped
def _aamp_across_series_nearest_neighbors(
Ts, Ts_idx, subseq_idx, m, Ts_squared, Ts_subseq_isfinite
):
k = len(Ts)
Q = Ts[Ts_idx][subseq_idx : subseq_idx + m]
Q_squared = np.sum(Q * Q)
nns_radii = np.zeros(k, dtype=np.float64)
nns_subse... | true | true |
1c4577dd8ddebd2c787183b01c730deb2a42ac5d | 1,252 | py | Python | tests/unit_tests/data/inline_service_integration_test/requester_service.py | ZacharyATanenbaum/service_framework | b5dde4407998350d1b7ad09284110b986fd4e12a | [
"MIT"
] | 1 | 2020-03-20T21:33:56.000Z | 2020-03-20T21:33:56.000Z | tests/unit_tests/data/inline_service_integration_test/requester_service.py | ZacharyATanenbaum/service_framework | b5dde4407998350d1b7ad09284110b986fd4e12a | [
"MIT"
] | 1 | 2020-03-22T03:48:45.000Z | 2020-03-22T03:48:45.000Z | tests/unit_tests/data/inline_service_integration_test/requester_service.py | ZacharyATanenbaum/service_framework | b5dde4407998350d1b7ad09284110b986fd4e12a | [
"MIT"
] | null | null | null | """ File to house a requester service """
from service_framework.utils.logging_utils import get_logger
LOG = get_logger()
def setup_config(config):
"""
Make config arguments the proper type!
"""
LOG.info('Setting up config!')
config['num_req_to_send'] = int(config.get('num_req_to_send', 2))
... | 22.357143 | 69 | 0.572684 |
from service_framework.utils.logging_utils import get_logger
LOG = get_logger()
def setup_config(config):
LOG.info('Setting up config!')
config['num_req_to_send'] = int(config.get('num_req_to_send', 2))
config['responses_recieved'] = []
return config
def main(to_send, config):
for num in range... | true | true |
1c4577df150e0de677cd366f5bf958d6cbeb0911 | 2,234 | py | Python | src/the_tale/the_tale/game/heroes/conf.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 85 | 2017-11-21T12:22:02.000Z | 2022-03-27T23:07:17.000Z | src/the_tale/the_tale/game/heroes/conf.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 545 | 2017-11-04T14:15:04.000Z | 2022-03-27T14:19:27.000Z | src/the_tale/the_tale/game/heroes/conf.py | Alacrate/the-tale | 43b211f3a99e93964e95abc20a8ed649a205ffcf | [
"BSD-3-Clause"
] | 45 | 2017-11-11T12:36:30.000Z | 2022-02-25T06:10:44.000Z |
import smart_imports
smart_imports.all()
NAME_REGEX = r'^[\-\ а-яА-Я«»\'ёЁ]+$' if not django_settings.TESTS_RUNNING else r'^[\-\ а-яА-Я«»\'\,ёЁ]+$'
settings = utils_app_settings.app_settings('HEROES',
USE_ABILITY_CHANCE=0.1,
MES... | 44.68 | 120 | 0.389884 |
import smart_imports
smart_imports.all()
NAME_REGEX = r'^[\-\ а-яА-Я«»\'ёЁ]+$' if not django_settings.TESTS_RUNNING else r'^[\-\ а-яА-Я«»\'\,ёЁ]+$'
settings = utils_app_settings.app_settings('HEROES',
USE_ABILITY_CHANCE=0.1,
MES... | true | true |
1c4579efb456751f3e85a187b14430807fac4cfc | 1,051 | py | Python | solutions/093.restore-ip-addresses/restore-ip-addresses.py | wangsongiam/leetcode | 96ff21bca1871816ae51fccb1fa13587b378dc50 | [
"MIT"
] | 3 | 2018-11-25T15:19:57.000Z | 2019-09-28T03:01:11.000Z | solutions/093.restore-ip-addresses/restore-ip-addresses.py | casprwang/leetcode | 96ff21bca1871816ae51fccb1fa13587b378dc50 | [
"MIT"
] | null | null | null | solutions/093.restore-ip-addresses/restore-ip-addresses.py | casprwang/leetcode | 96ff21bca1871816ae51fccb1fa13587b378dc50 | [
"MIT"
] | 3 | 2018-02-11T20:23:44.000Z | 2020-06-05T15:39:56.000Z | class Solution:
def restoreIpAddresses(self, s):
"""
:type s: str
:rtype: List[str]
"""
ret = []
def traverse(pos, cnt, tmp):
print(tmp)
nonlocal ret, s
if cnt == 0:
if not s[pos:]:
return
... | 26.948718 | 95 | 0.358706 | class Solution:
def restoreIpAddresses(self, s):
ret = []
def traverse(pos, cnt, tmp):
print(tmp)
nonlocal ret, s
if cnt == 0:
if not s[pos:]:
return
if len(s[pos:]) > 1 and s[pos:][0] == '0':
... | true | true |
1c457a9117673b494d492a9f4ab781bd3957996b | 1,632 | py | Python | Data Scientist Career Path/12. Foundations of Machine Learning Unsupervised Learning/2. KMeans++/1. intro.py | myarist/Codecademy | 2ba0f104bc67ab6ef0f8fb869aa12aa02f5f1efb | [
"MIT"
] | 23 | 2021-06-06T15:35:55.000Z | 2022-03-21T06:53:42.000Z | Data Scientist Career Path/12. Foundations of Machine Learning Unsupervised Learning/2. KMeans++/1. intro.py | shivaniverma1/Data-Scientist | f82939a411484311171465591455880c8e354750 | [
"MIT"
] | null | null | null | Data Scientist Career Path/12. Foundations of Machine Learning Unsupervised Learning/2. KMeans++/1. intro.py | shivaniverma1/Data-Scientist | f82939a411484311171465591455880c8e354750 | [
"MIT"
] | 9 | 2021-06-08T01:32:04.000Z | 2022-03-18T15:38:09.000Z | import codecademylib3_seaborn
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.cluster import KMeans
import random
import timeit
mu = 1
std = 0.5
np.random.seed(100)
xs = np.append(np.append(np.append(np.random.normal(0.25,std,100), np.random.normal(0.75,std,100)), np.random.norma... | 27.2 | 164 | 0.712623 | import codecademylib3_seaborn
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.cluster import KMeans
import random
import timeit
mu = 1
std = 0.5
np.random.seed(100)
xs = np.append(np.append(np.append(np.random.normal(0.25,std,100), np.random.normal(0.75,std,100)), np.random.norma... | true | true |
1c457b258f46e8b97aa913da1acea83fba03eaed | 944 | py | Python | rrpython/tests/types/test_str.py | afoolsbag/rrPython | cb4d376b7c02e39d4e88163f272456ebb9eeafc9 | [
"Unlicense"
] | null | null | null | rrpython/tests/types/test_str.py | afoolsbag/rrPython | cb4d376b7c02e39d4e88163f272456ebb9eeafc9 | [
"Unlicense"
] | null | null | null | rrpython/tests/types/test_str.py | afoolsbag/rrPython | cb4d376b7c02e39d4e88163f272456ebb9eeafc9 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
r"""
字符串类型。
::
+-> Container: obj.__contains__(self, item) # item in obj
|
+-> Sized: obj.__len__(self) # len(obj)
|
+-> Iterable: obj.__iter__(self) # iter(obj)
|
+-> Collection
|
... | 23.02439 | 89 | 0.54661 |
__version__ = '2020.09.27'
__since__ = '2020.09.24'
__author__ = 'zhengrr'
__license__ = 'UNLICENSE'
from typing import Sequence
def test_issubclass() -> None:
assert issubclass(str, Sequence)
| true | true |
1c457bc8969abfb76d85c1df6226dd8f0956c564 | 13,447 | py | Python | lime/optics.py | binggu56/lime | 07f60c5105f0bedb11ac389fd671f4f1737a71fe | [
"MIT"
] | 4 | 2020-01-15T11:52:23.000Z | 2021-01-05T19:40:36.000Z | lime/optics.py | binggu56/lime | 07f60c5105f0bedb11ac389fd671f4f1737a71fe | [
"MIT"
] | null | null | null | lime/optics.py | binggu56/lime | 07f60c5105f0bedb11ac389fd671f4f1737a71fe | [
"MIT"
] | 3 | 2020-02-14T07:10:44.000Z | 2021-04-14T17:49:45.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 26 17:26:02 2019
@author: binggu
"""
import numpy as np
from scipy.sparse import lil_matrix, csr_matrix, kron, identity, linalg
from numpy import sqrt, exp, pi
import matplotlib.pyplot as plt
from lime.units import au2k, au2ev
from lime.fft import... | 22.791525 | 93 | 0.512605 |
import numpy as np
from scipy.sparse import lil_matrix, csr_matrix, kron, identity, linalg
from numpy import sqrt, exp, pi
import matplotlib.pyplot as plt
from lime.units import au2k, au2ev
from lime.fft import fft2
from lime.phys import rect, sinc, dag, interval
from lime.style import set_style, imshow
from numba... | true | true |
1c457ce30654b4e60fe6ac59186a1c9d26859b54 | 10,225 | py | Python | glance_docker/glance/common/auth.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | glance_docker/glance/common/auth.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | glance_docker/glance/common/auth.py | tobegit3hub/dockerized-software | 3781bc1145b6fbb8d5fa2e2eaeaa3aa138a69632 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 34.897611 | 79 | 0.603619 |
import httplib2
from oslo_log import log as logging
from oslo_serialization import jsonutils
from six.moves import range
import six.moves.urllib.parse as urlparse
from glance.common import exception
from glance import i18n
LOG = logging.getLogger(__name__)
_ = i18n._
class BaseStrategy(object):
... | true | true |
1c457cf430666778cca067fee9e66d2b156178b1 | 2,193 | py | Python | ropgenerator/exploit/syscall/SyscallLinuxX86.py | avltree9798/ropgenerator | c63c81f03e8653dc3911e21300c00003a4224f6a | [
"MIT"
] | 1 | 2021-01-07T13:16:19.000Z | 2021-01-07T13:16:19.000Z | ropgenerator/exploit/syscall/SyscallLinuxX86.py | avltree9798/ropgenerator | c63c81f03e8653dc3911e21300c00003a4224f6a | [
"MIT"
] | null | null | null | ropgenerator/exploit/syscall/SyscallLinuxX86.py | avltree9798/ropgenerator | c63c81f03e8653dc3911e21300c00003a4224f6a | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# SycallLinuxX86 module: build syscalls for linux on X64
from ropgenerator.exploit.syscall.SyscallGeneric import Syscall, ArgType
from ropgenerator.core.Architecture import *
mprotect = Syscall('int', 'mprotect', \
[('void*', 'addr'),('size_t','len'),('int','prot')], [ArgType.INT, ArgTyp... | 37.810345 | 122 | 0.632011 |
from ropgenerator.exploit.syscall.SyscallGeneric import Syscall, ArgType
from ropgenerator.core.Architecture import *
mprotect = Syscall('int', 'mprotect', \
[('void*', 'addr'),('size_t','len'),('int','prot')], [ArgType.INT, ArgType.INT, ArgType.INT],\
[RegX86.EBX, RegX86.ECX, RegX86.EDX], [(RegX86.EAX, 0... | true | true |
1c457d19c80113b1224bc3ece869c3003a166dee | 690 | py | Python | molecule/default/tests/test_default.py | dhs-ncats/ansible-role-htop | a7848a00693e9e841e3546d879968704228b47a4 | [
"CC0-1.0"
] | null | null | null | molecule/default/tests/test_default.py | dhs-ncats/ansible-role-htop | a7848a00693e9e841e3546d879968704228b47a4 | [
"CC0-1.0"
] | null | null | null | molecule/default/tests/test_default.py | dhs-ncats/ansible-role-htop | a7848a00693e9e841e3546d879968704228b47a4 | [
"CC0-1.0"
] | null | null | null | """Module containing the tests for the default scenario."""
# Standard Python Libraries
import os
# Third-Party Libraries
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
@pytest.mark.par... | 23.793103 | 63 | 0.731884 |
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
@pytest.mark.parametrize("pkg", ["htop"])
def test_packages(host, pkg):
package = host.package(pkg)
assert package.is... | true | true |
1c457edb6c9ecbc1d978023d080823ab44d6d1d2 | 560 | py | Python | integration/emulator/test.py | cvlabmiet/master-programming-example | 8a4a231ba2b72a93ae14da2c04e17b2ae3fc6651 | [
"MIT"
] | null | null | null | integration/emulator/test.py | cvlabmiet/master-programming-example | 8a4a231ba2b72a93ae14da2c04e17b2ae3fc6651 | [
"MIT"
] | null | null | null | integration/emulator/test.py | cvlabmiet/master-programming-example | 8a4a231ba2b72a93ae14da2c04e17b2ae3fc6651 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys, random, array
sys.dont_write_bytecode = True
from device import Pram, Lram
test_vector = list(range(0, 200))
random.shuffle(test_vector)
pram = Pram()
lram = Lram()
lram[:] = bytes(test_vector)
pram[:] = b'[u16:200:400]add(u8:0, u8:100)'
pram.run(lram)
view = memoryview(lram)[2... | 20.740741 | 73 | 0.664286 |
import sys, random, array
sys.dont_write_bytecode = True
from device import Pram, Lram
test_vector = list(range(0, 200))
random.shuffle(test_vector)
pram = Pram()
lram = Lram()
lram[:] = bytes(test_vector)
pram[:] = b'[u16:200:400]add(u8:0, u8:100)'
pram.run(lram)
view = memoryview(lram)[200:400].cast('H')
erro... | true | true |
1c457f19469eb820eb88da2d97435a799d4d316b | 1,354 | py | Python | crslab/model/__init__.py | Xiaolong-Qi/CRSLab | d507378c86f4996727bf062482e1f224486d4533 | [
"MIT"
] | 1 | 2021-01-06T10:39:10.000Z | 2021-01-06T10:39:10.000Z | crslab/model/__init__.py | Xiaolong-Qi/CRSLab | d507378c86f4996727bf062482e1f224486d4533 | [
"MIT"
] | null | null | null | crslab/model/__init__.py | Xiaolong-Qi/CRSLab | d507378c86f4996727bf062482e1f224486d4533 | [
"MIT"
] | null | null | null | # @Time : 2020/11/22
# @Author : Kun Zhou
# @Email : francis_kun_zhou@163.com
# UPDATE:
# @Time : 2020/11/24, 2020/12/24
# @Author : Kun Zhou, Xiaolei Wang
# @Email : francis_kun_zhou@163.com, wxl1999@foxmail.com
from loguru import logger
from .conversation import *
from .kbrd import *
from .kgsf import *
from... | 27.08 | 91 | 0.6839 |
from loguru import logger
from .conversation import *
from .kbrd import *
from .kgsf import *
from .policy import *
from .recommendation import *
from .redial import *
from .tgredial import *
Model_register_table = {
'KGSF': KGSFModel,
'KBRD': KBRDModel,
'TGRec': TGRecModel,
'TGConv': TGConvM... | true | true |
1c457faa9ac5bd092b0c88919dffda9a035f0f60 | 8,729 | py | Python | ckan_cloud_operator/providers/storage/minio/manager.py | mickeyrouash/ckan-cloud-operator | 10e38f13964af30fe57b07e8d8a3b7521ed69cc2 | [
"MIT"
] | null | null | null | ckan_cloud_operator/providers/storage/minio/manager.py | mickeyrouash/ckan-cloud-operator | 10e38f13964af30fe57b07e8d8a3b7521ed69cc2 | [
"MIT"
] | null | null | null | ckan_cloud_operator/providers/storage/minio/manager.py | mickeyrouash/ckan-cloud-operator | 10e38f13964af30fe57b07e8d8a3b7521ed69cc2 | [
"MIT"
] | null | null | null | #### standard provider code ####
# import the correct PROVIDER_SUBMODULE and PROVIDER_ID constants for your provider
from .constants import PROVIDER_ID
from ..constants import PROVIDER_SUBMODULE
# define common provider functions based on the constants
from ckan_cloud_operator.providers import manager as providers_ma... | 44.764103 | 273 | 0.680719 | perator.providers import manager as providers_manager
def _get_resource_name(suffix=None): return providers_manager.get_resource_name(PROVIDER_SUBMODULE, PROVIDER_ID, suffix=suffix)
def _get_resource_labels(for_deployment=False, suffix=None): return providers_manager.get_resource_labels(PROVIDER_SUBMODULE, PROVIDER_ID,... | true | true |
1c4580a46e7319d59ea9439c79f77deb41aaa8c2 | 5,708 | py | Python | luigi/rpc.py | miku/luigi | 889ef2af64e2aa7d0cc65caef69a241ac91e5ff9 | [
"Apache-2.0"
] | 4 | 2017-03-21T20:01:19.000Z | 2022-03-29T16:31:41.000Z | luigi/rpc.py | miku/luigi | 889ef2af64e2aa7d0cc65caef69a241ac91e5ff9 | [
"Apache-2.0"
] | 9 | 2017-03-22T23:38:48.000Z | 2019-01-28T21:13:06.000Z | luigi/rpc.py | miku/luigi | 889ef2af64e2aa7d0cc65caef69a241ac91e5ff9 | [
"Apache-2.0"
] | 2 | 2015-05-04T22:46:20.000Z | 2016-07-14T17:58:57.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | 33.380117 | 104 | 0.653644 |
import os
import json
import logging
import socket
import time
from luigi.six.moves.urllib.parse import urljoin, urlencode, urlparse
from luigi.six.moves.urllib.request import urlopen
from luigi.six.moves.urllib.error import URLError
from luigi import configuration
from luigi.scheduler import RPC_METH... | true | true |
1c4581505fbb614f1ce2848ca80ed21dafdc2751 | 1,094 | py | Python | quick_start.py | willin007/kucoin_sdk | a4967c9f684aa4917a4b9e668d43520307eb9d30 | [
"MIT"
] | null | null | null | quick_start.py | willin007/kucoin_sdk | a4967c9f684aa4917a4b9e668d43520307eb9d30 | [
"MIT"
] | null | null | null | quick_start.py | willin007/kucoin_sdk | a4967c9f684aa4917a4b9e668d43520307eb9d30 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/11/4 10:50 上午
# @Author : william.li
# @File : quick_start.py
# @Software: PyCharm
# MarketData
import asyncio
from kucoin.client import WsToken
from kucoin.ws_client import KucoinWsClient
async def main():
async def deal_msg(msg):
if ms... | 29.567568 | 82 | 0.652651 |
import asyncio
from kucoin.client import WsToken
from kucoin.ws_client import KucoinWsClient
async def main():
async def deal_msg(msg):
if msg['topic'] == '/spotMarket/level2Depth5:BTC-USDT':
print(msg["data"])
elif msg['topic'] == '/spotMarket/level2Depth5:KCS-USDT':
... | true | true |
1c458274e5efd6aadb13edda9285a4822068f1f7 | 13,123 | py | Python | translate_mustache.py | yahoo/Gordito | 031c87e82a06002fd41b601668a9ef6c0fc2d85c | [
"MIT"
] | null | null | null | translate_mustache.py | yahoo/Gordito | 031c87e82a06002fd41b601668a9ef6c0fc2d85c | [
"MIT"
] | null | null | null | translate_mustache.py | yahoo/Gordito | 031c87e82a06002fd41b601668a9ef6c0fc2d85c | [
"MIT"
] | null | null | null | import sys
import os
import re
#Copyright (c) 2012 Yahoo! Inc. All rights reserved.
#Copyrights licensed under the MIT License. See the accompanying LICENSE file
#for terms.
# define command line options
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-f", "--f", dest="filename", help... | 34.44357 | 166 | 0.522518 | import sys
import os
import re
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-f", "--f", dest="filename", help="The mustache template to process")
parser.add_option("-r", "--rollup", dest="rollup", action="store_true", help="Rollup this template and it's dependencies into a single ... | false | true |
1c45828c2da100de725a4b389922ca6abe3ce11d | 1,901 | py | Python | setup.py | cajfisher/vasppy | a460db14163b7db3bce54d754dd476c45a3ed85b | [
"MIT"
] | 28 | 2017-02-16T13:22:34.000Z | 2021-04-29T06:10:10.000Z | setup.py | cajfisher/vasppy | a460db14163b7db3bce54d754dd476c45a3ed85b | [
"MIT"
] | 15 | 2016-05-09T13:08:42.000Z | 2021-08-09T10:59:58.000Z | setup.py | cajfisher/vasppy | a460db14163b7db3bce54d754dd476c45a3ed85b | [
"MIT"
] | 25 | 2015-10-12T11:29:22.000Z | 2021-08-20T17:33:27.000Z | """
vasppy: Python utilities for working with VASP inputs and outputs.
"""
from setuptools import setup, find_packages
from vasppy.version import __version__ as VERSION
readme = 'README.md'
long_description = open(readme).read()
scripts = ['check_species',
'murnfit',
'vasp_summary',
... | 31.683333 | 88 | 0.538138 |
from setuptools import setup, find_packages
from vasppy.version import __version__ as VERSION
readme = 'README.md'
long_description = open(readme).read()
scripts = ['check_species',
'murnfit',
'vasp_summary',
'poscar_to_cif',
'potcar_spec',
'effective_mass',
... | true | true |
1c4582bb37d8bf82a9eadb8ac9e0bbddd1dde76a | 7,194 | py | Python | hack/boilerplate/boilerplate.py | moelsayed/kubeone | bec424b09d2d0cb5d97347469c947ab66c5c1d91 | [
"Apache-2.0"
] | 1 | 2020-02-13T17:46:28.000Z | 2020-02-13T17:46:28.000Z | hack/boilerplate/boilerplate.py | moelsayed/kubeone | bec424b09d2d0cb5d97347469c947ab66c5c1d91 | [
"Apache-2.0"
] | null | null | null | hack/boilerplate/boilerplate.py | moelsayed/kubeone | bec424b09d2d0cb5d97347469c947ab66c5c1d91 | [
"Apache-2.0"
] | 1 | 2020-05-06T15:33:38.000Z | 2020-05-06T15:33:38.000Z | #!/usr/bin/env python
# Copyright 2019 The KubeOne 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 applicab... | 29.604938 | 124 | 0.630108 |
from __future__ import print_function
import argparse
import datetime
import difflib
import glob
import os
import re
import sys
parser = argparse.ArgumentParser()
parser.add_argument(
"filenames",
help="list of files to check, all files if unspecified",
nargs='*')
rootdir = os.path.dirnam... | true | true |
1c45839120b9c193c462707af258c3c9bfffdfa3 | 568 | py | Python | tests/test_level1/test_visited.py | kianmeng/soupsieve | a8640aad6ae0476e6b62f4f15e12ad4efc7605c4 | [
"MIT"
] | 130 | 2018-12-27T06:00:32.000Z | 2022-03-29T05:47:18.000Z | tests/test_level1/test_visited.py | kianmeng/soupsieve | a8640aad6ae0476e6b62f4f15e12ad4efc7605c4 | [
"MIT"
] | 157 | 2018-12-07T07:44:15.000Z | 2022-02-05T16:20:08.000Z | tests/test_level1/test_visited.py | kianmeng/soupsieve | a8640aad6ae0476e6b62f4f15e12ad4efc7605c4 | [
"MIT"
] | 32 | 2018-12-31T03:11:55.000Z | 2022-03-06T09:06:43.000Z | """Test visited selectors."""
from .. import util
class TestVisited(util.TestCase):
"""Test visited selectors."""
def test_visited(self):
"""Test visited."""
markup = """
<div>
<p>Some text <span id="1" class="foo:bar:foobar"> in a paragraph</span>.
<a id="2" class="b... | 21.846154 | 80 | 0.482394 | from .. import util
class TestVisited(util.TestCase):
def test_visited(self):
markup = """
<div>
<p>Some text <span id="1" class="foo:bar:foobar"> in a paragraph</span>.
<a id="2" class="bar" href="http://google.com">Link</a>
<a id="3">Placeholder text.</a>
</p>
... | true | true |
1c4584ac1bc01ab917fbb00db92b230e45196a27 | 5,228 | py | Python | export.py | OleksandrBlack/safecoinnodes | 0021edc8e72e078fcd7bedb465292c96caeeb148 | [
"MIT"
] | null | null | null | export.py | OleksandrBlack/safecoinnodes | 0021edc8e72e078fcd7bedb465292c96caeeb148 | [
"MIT"
] | null | null | null | export.py | OleksandrBlack/safecoinnodes | 0021edc8e72e078fcd7bedb465292c96caeeb148 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# export.py - Exports enumerated data for reachable nodes into a JSON file.
#
# Copyright (c) Addy Yeow Chin Heng <ayeowch@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (th... | 32.271605 | 79 | 0.655318 |
import json
import logging
import os
import sys
import time
from binascii import hexlify, unhexlify
from ConfigParser import ConfigParser
from utils import new_redis_conn
REDIS_CONN = None
CONF = {}
def get_row(node):
node = eval(node)
address = node[0]
port = node[1]
... | true | true |
1c4584cb83547e7b831785c85e43413291a71a8c | 2,135 | py | Python | Stopwatch.py | arapawa/stopwatch-game | 5ee64e04a8dc15ead2dcd8a661105ae1c9087317 | [
"MIT"
] | null | null | null | Stopwatch.py | arapawa/stopwatch-game | 5ee64e04a8dc15ead2dcd8a661105ae1c9087317 | [
"MIT"
] | 1 | 2016-12-30T06:59:12.000Z | 2016-12-30T06:59:12.000Z | Stopwatch.py | arapawa/stopwatch-game | 5ee64e04a8dc15ead2dcd8a661105ae1c9087317 | [
"MIT"
] | null | null | null | # "Stopwatch: The Game"
# tenth of a second between every tick
# every time timer ticks, it will update a global variable by one
import simplegui
# define global variables
time = 0
success = 0
attempts = 0
counter = 0
# variable to ensure score can only be increased after stopwatch was running
stopwatch... | 26.036585 | 79 | 0.640281 |
import simplegui
time = 0
success = 0
attempts = 0
counter = 0
stopwatch_running = False
def format(t):
a_time = t // 600
b_time = ((t / 10) % 60) // 10
c_time = ((t / 10) % 60) % 10
d_time = t % 10
return str(a_time) + ":" + str(b_time) + str(c_time) + "." + str(d_time)
... | true | true |
1c458641abbee4ca565c0de49e6620d72012ccb6 | 20,836 | py | Python | cripts/relationships/handlers.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | 2 | 2017-04-06T12:26:11.000Z | 2018-11-05T19:17:15.000Z | cripts/relationships/handlers.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | 9 | 2016-09-28T10:19:10.000Z | 2017-02-24T17:58:43.000Z | cripts/relationships/handlers.py | lakiw/cripts | 43f62891a3724e1ec60629887d97c421fb302163 | [
"MIT"
] | null | null | null | import datetime
from dateutil.parser import parse
from cripts.core.class_mapper import class_from_id
def get_relationships(obj=None, type_=None, id_=None, analyst=None):
"""
Get relationships for a top-level object.
:param obj: The top-level object to get relationships for.
:type obj: :class:`cripts... | 42.522449 | 95 | 0.578038 | import datetime
from dateutil.parser import parse
from cripts.core.class_mapper import class_from_id
def get_relationships(obj=None, type_=None, id_=None, analyst=None):
if obj:
return obj.sort_relationships("%s" % analyst, meta=True)
elif type_ and id_:
obj = class_from_id(type_, id_)
... | true | true |
1c45866e5a644fc50a8ed3659b45f9a0dee3b769 | 1,731 | py | Python | pytorch/skin_lesion_classification/plots.py | deephealthproject/use-case-pipelines | ea9c8aedfbc9084e1a5350f6f73def2578258c77 | [
"MIT"
] | 1 | 2020-05-20T16:57:11.000Z | 2020-05-20T16:57:11.000Z | pytorch/skin_lesion_classification/plots.py | deephealthproject/use-case-pipelines | ea9c8aedfbc9084e1a5350f6f73def2578258c77 | [
"MIT"
] | 5 | 2021-03-26T16:01:51.000Z | 2021-09-20T13:53:22.000Z | pytorch/skin_lesion_classification/plots.py | deephealthproject/use-case-pipelines | ea9c8aedfbc9084e1a5350f6f73def2578258c77 | [
"MIT"
] | 5 | 2020-05-18T09:44:03.000Z | 2020-11-29T12:58:28.000Z | import itertools
import matplotlib.pyplot as plt
import numpy as np
def plot_sequence(filename, sequences, legend=None):
"""Plots one or more sequences of values into a file
:param filename: output filename
:param sequences: (M x N) array-like structure containing M sequences of N values
:param lege... | 29.844828 | 85 | 0.617562 | import itertools
import matplotlib.pyplot as plt
import numpy as np
def plot_sequence(filename, sequences, legend=None):
fig = plt.figure()
for sequence in sequences:
plt.plot(range(len(sequence)), sequence)
if legend:
plt.legend(legend)
plt.savefig(filename)
plt.close(fig)
def ... | true | true |
1c4586bd66611dfec7cf8c2a805839086f354af2 | 232 | py | Python | lib/JumpScale/baselib/dnsman/dnsFactory.py | rudecs/jumpscale_core7 | 30c03f26f1cdad3edbb9d79d50fbada8acc974f5 | [
"Apache-2.0"
] | null | null | null | lib/JumpScale/baselib/dnsman/dnsFactory.py | rudecs/jumpscale_core7 | 30c03f26f1cdad3edbb9d79d50fbada8acc974f5 | [
"Apache-2.0"
] | 4 | 2016-08-25T12:08:39.000Z | 2018-04-12T12:36:01.000Z | lib/JumpScale/baselib/dnsman/dnsFactory.py | rudecs/jumpscale_core7 | 30c03f26f1cdad3edbb9d79d50fbada8acc974f5 | [
"Apache-2.0"
] | 3 | 2016-03-08T07:49:34.000Z | 2018-10-19T13:56:43.000Z | from bind import BindDNS
class DNSFactory(object):
def __init__(self):
self.bindObj = None
@property
def bind(self):
if not self.bindObj:
self.bindObj = BindDNS()
return self.bindObj | 21.090909 | 36 | 0.612069 | from bind import BindDNS
class DNSFactory(object):
def __init__(self):
self.bindObj = None
@property
def bind(self):
if not self.bindObj:
self.bindObj = BindDNS()
return self.bindObj | true | true |
1c45875f0c9405efffecbefbf3c272cc94cee782 | 7,536 | py | Python | main/cloudfoundry_client/v2/entities.py | subhash12/cf-python-client | c0ecbb8ec85040fc2f74b6c52e1f9a6c6c16c4b0 | [
"Apache-2.0"
] | null | null | null | main/cloudfoundry_client/v2/entities.py | subhash12/cf-python-client | c0ecbb8ec85040fc2f74b6c52e1f9a6c6c16c4b0 | [
"Apache-2.0"
] | null | null | null | main/cloudfoundry_client/v2/entities.py | subhash12/cf-python-client | c0ecbb8ec85040fc2f74b6c52e1f9a6c6c16c4b0 | [
"Apache-2.0"
] | null | null | null | from functools import partial, reduce
from typing import Callable, List, Tuple, Any, Optional, Generator, TYPE_CHECKING
from urllib.parse import quote
from requests import Response
from cloudfoundry_client.errors import InvalidEntity
from cloudfoundry_client.json_object import JsonObject
from cloudfoundry_client.reque... | 43.813953 | 129 | 0.625398 | from functools import partial, reduce
from typing import Callable, List, Tuple, Any, Optional, Generator, TYPE_CHECKING
from urllib.parse import quote
from requests import Response
from cloudfoundry_client.errors import InvalidEntity
from cloudfoundry_client.json_object import JsonObject
from cloudfoundry_client.reque... | true | true |
1c4587d7f261fcbda3642a50322883ae48f591a2 | 8,013 | py | Python | karton/config_extractor/config_extractor.py | kscieslinski/karton-config-extractor | c0eb0bddeed2b217abe517ca1b8a20e679506dba | [
"BSD-3-Clause"
] | null | null | null | karton/config_extractor/config_extractor.py | kscieslinski/karton-config-extractor | c0eb0bddeed2b217abe517ca1b8a20e679506dba | [
"BSD-3-Clause"
] | null | null | null | karton/config_extractor/config_extractor.py | kscieslinski/karton-config-extractor | c0eb0bddeed2b217abe517ca1b8a20e679506dba | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
import gc
import hashlib
import json
import os
import re
from karton.core import Config, Karton, Resource, Task
from karton.core.resource import ResourceBase
from malduck.extractor import ExtractManager, ExtractorModules
from .__version__ import __version__
class AnalysisExtractManager(ExtractMan... | 34.097872 | 85 | 0.539998 |
import gc
import hashlib
import json
import os
import re
from karton.core import Config, Karton, Resource, Task
from karton.core.resource import ResourceBase
from malduck.extractor import ExtractManager, ExtractorModules
from .__version__ import __version__
class AnalysisExtractManager(ExtractManager):
def __... | true | true |
1c458914cb33dd348d349ab2d97c4bf9208ef056 | 6,011 | py | Python | Code/PrepareTables/SelectedROICorrs_positionVar.py | cirmuw/functional-twin-analysis | b6730f09f2143d5372f1a90d5fac47e3385e54fb | [
"Apache-2.0"
] | null | null | null | Code/PrepareTables/SelectedROICorrs_positionVar.py | cirmuw/functional-twin-analysis | b6730f09f2143d5372f1a90d5fac47e3385e54fb | [
"Apache-2.0"
] | null | null | null | Code/PrepareTables/SelectedROICorrs_positionVar.py | cirmuw/functional-twin-analysis | b6730f09f2143d5372f1a90d5fac47e3385e54fb | [
"Apache-2.0"
] | null | null | null | #script to create tabels containig x, y and z coordinates of functionally corresponding vertices (position variability) for each twin, one table per vertex
#input:id of functionally corresponding vetices of each twin to reference
#output: tables with vertex position in each subject, one table per vetex
import numpy as ... | 38.044304 | 155 | 0.683081 |
import numpy as np
import nibabel as nib
import pandas as pd
from glob import glob
import os, sys
currentdir = os.path.dirname(os.path.realpath(__file__))
parentdir = os.path.dirname(currentdir)
sys.path.append(parentdir)
import settings as s
import pickle
infile =s.HCP_information_sheet_path
subjectpath1=s... | true | true |
1c458b871efd7083878ac19fd4aba0ef100e5f65 | 12,721 | py | Python | libs/curveLib/open_all.py | ledummy/CoMPlEx | f315df7a1b13cfcbdafd9879ff93a974f2e2c38b | [
"MIT"
] | null | null | null | libs/curveLib/open_all.py | ledummy/CoMPlEx | f315df7a1b13cfcbdafd9879ff93a974f2e2c38b | [
"MIT"
] | 1 | 2020-04-08T12:55:50.000Z | 2020-04-08T12:55:50.000Z | libs/curveLib/open_all.py | ledummy/CoMPlEx | f315df7a1b13cfcbdafd9879ff93a974f2e2c38b | [
"MIT"
] | 1 | 2020-04-08T12:44:47.000Z | 2020-04-08T12:44:47.000Z | import segment
import logging
import string
class openWorker():
def __init__(self,fname):
self.fname = fname
self.parameters={}
self.info={}
self.segments=[]
def parseConfigLine(self,cline,newline='\r\n'):
line = cline[2:-len(newline)]
# columns: vDeflection str... | 34.381081 | 151 | 0.398003 | import segment
import logging
import string
class openWorker():
def __init__(self,fname):
self.fname = fname
self.parameters={}
self.info={}
self.segments=[]
def parseConfigLine(self,cline,newline='\r\n'):
line = cline[2:-len(newline)]
if line.... | false | true |
1c458bedfb80717a0139eb3f7187e74d5601bb56 | 477 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/basic/templatetags/form_tags.py | cubicuboctahedron/cookiecutter-django-wagtail | d7f668ce09ba2c4a3f98045ab8a6fcd286d36553 | [
"Apache-2.0"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/basic/templatetags/form_tags.py | cubicuboctahedron/cookiecutter-django-wagtail | d7f668ce09ba2c4a3f98045ab8a6fcd286d36553 | [
"Apache-2.0"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/basic/templatetags/form_tags.py | cubicuboctahedron/cookiecutter-django-wagtail | d7f668ce09ba2c4a3f98045ab8a6fcd286d36553 | [
"Apache-2.0"
] | 1 | 2020-04-07T10:07:07.000Z | 2020-04-07T10:07:07.000Z | from django import template
register = template.Library()
@register.filter(name='addcss')
def addcss(field, css):
return field.as_widget(attrs={"class":css})
@register.filter(name='add_attributes')
def add_attributes(field, css):
attrs = {}
definition = css.split(',')
for d in definition:
if ... | 21.681818 | 46 | 0.597484 | from django import template
register = template.Library()
@register.filter(name='addcss')
def addcss(field, css):
return field.as_widget(attrs={"class":css})
@register.filter(name='add_attributes')
def add_attributes(field, css):
attrs = {}
definition = css.split(',')
for d in definition:
if ... | true | true |
1c458c303d4a0d97db1662628a538701eb8cf2dd | 1,049 | py | Python | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/BatchTaskCreateInDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 128 | 2018-10-29T04:11:47.000Z | 2022-03-07T02:19:14.000Z | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/BatchTaskCreateInDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 40 | 2018-11-02T00:40:48.000Z | 2021-12-07T09:33:56.000Z | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/BatchTaskCreateInDTO.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 118 | 2018-10-29T08:43:57.000Z | 2022-01-07T06:49:25.000Z | from com.huawei.iotplatform.client.dto.ObjectNode import ObjectNode
from com.huawei.iotplatform.client.dto.TagDTO2 import TagDTO2
class BatchTaskCreateInDTO(object):
tags = TagDTO2
param = ObjectNode
def __init__(self):
self.appId = None
self.taskName = None
self.taskType = None
... | 20.98 | 67 | 0.638704 | from com.huawei.iotplatform.client.dto.ObjectNode import ObjectNode
from com.huawei.iotplatform.client.dto.TagDTO2 import TagDTO2
class BatchTaskCreateInDTO(object):
tags = TagDTO2
param = ObjectNode
def __init__(self):
self.appId = None
self.taskName = None
self.taskType = None
... | true | true |
1c458e127c7a31bedae9e99bb85864dbcdac3092 | 20,718 | py | Python | nova/api/openstack/compute/legacy_v2/contrib/security_groups.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2016-04-28T16:20:38.000Z | 2021-04-25T11:19:03.000Z | nova/api/openstack/compute/legacy_v2/contrib/security_groups.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/legacy_v2/contrib/security_groups.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2020-04-08T20:24:45.000Z | 2020-10-05T19:02:13.000Z | # Copyright 2011 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
# 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/l... | 40.863905 | 79 | 0.592383 |
import contextlib
from xml.dom import minidom
from oslo_log import log as logging
from oslo_serialization import jsonutils
import six
import webob
from webob import exc
from nova.api.openstack import common
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import... | true | true |
1c458edcdd1b7f3f78cef784442634fe79c4c946 | 78 | py | Python | ass_17.py | Divyanshi0409/Python-Programs | 7fb8ab2159cc69de7168bf19f91325b9c7a908c7 | [
"MIT"
] | null | null | null | ass_17.py | Divyanshi0409/Python-Programs | 7fb8ab2159cc69de7168bf19f91325b9c7a908c7 | [
"MIT"
] | null | null | null | ass_17.py | Divyanshi0409/Python-Programs | 7fb8ab2159cc69de7168bf19f91325b9c7a908c7 | [
"MIT"
] | null | null | null | for i in range(50,81):
if i%2==0:
print(i)
else:
break | 15.6 | 22 | 0.448718 | for i in range(50,81):
if i%2==0:
print(i)
else:
break | true | true |
1c458f5175cf9bf35887e6e17a55a96733dcd698 | 2,954 | py | Python | pint/testing.py | fernandezc/pint | 37a61ede6fbd628c7dc160eb36278cf41c96484c | [
"BSD-3-Clause"
] | null | null | null | pint/testing.py | fernandezc/pint | 37a61ede6fbd628c7dc160eb36278cf41c96484c | [
"BSD-3-Clause"
] | null | null | null | pint/testing.py | fernandezc/pint | 37a61ede6fbd628c7dc160eb36278cf41c96484c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
import math
import warnings
from numbers import Number
from . import Quantity
from .compat import ndarray
try:
import numpy as np
except ImportError:
np = None
def _get_comparable_magnitudes(first, second, msg):
if isinstance(first, Quantity) and isinstance(second, Qu... | 31.763441 | 78 | 0.618822 | from __future__ import annotations
import math
import warnings
from numbers import Number
from . import Quantity
from .compat import ndarray
try:
import numpy as np
except ImportError:
np = None
def _get_comparable_magnitudes(first, second, msg):
if isinstance(first, Quantity) and isinstance(second, Qu... | true | true |
1c458f9ed188a3d53e4a024d3cb10478bdd12173 | 4,733 | py | Python | sudoku/sudoku/gensudoku.py | PoojithRachakada/sudoku-django | 723de992821e54b63259c00fb949fdfa1e05ac04 | [
"MIT"
] | null | null | null | sudoku/sudoku/gensudoku.py | PoojithRachakada/sudoku-django | 723de992821e54b63259c00fb949fdfa1e05ac04 | [
"MIT"
] | 5 | 2020-12-31T09:42:57.000Z | 2021-01-05T13:59:14.000Z | sudoku/sudoku/gensudoku.py | PoojithRachakada/sudoku-django | 723de992821e54b63259c00fb949fdfa1e05ac04 | [
"MIT"
] | null | null | null | # pylint: disable=unused-variable
import os
import sys
from io import BytesIO, IOBase
import math
import itertools as ITER
from collections import defaultdict as D
from collections import Counter as CO
from collections import deque as Q
import threading
from functools import lru_cache, reduce
from functools ... | 27.358382 | 60 | 0.427002 |
import os
import sys
from io import BytesIO, IOBase
import math
import itertools as ITER
from collections import defaultdict as D
from collections import Counter as CO
from collections import deque as Q
import threading
from functools import lru_cache, reduce
from functools import cmp_to_key as CMP
from bis... | true | true |
1c4590d51df3d7bf9eea558bb224c176d93b580d | 4,832 | py | Python | fastmot/utils/visualization.py | rafcy/FastMOT | 9aee101b1ac83a5fea8cece1f8cfda8030adb743 | [
"MIT"
] | null | null | null | fastmot/utils/visualization.py | rafcy/FastMOT | 9aee101b1ac83a5fea8cece1f8cfda8030adb743 | [
"MIT"
] | null | null | null | fastmot/utils/visualization.py | rafcy/FastMOT | 9aee101b1ac83a5fea8cece1f8cfda8030adb743 | [
"MIT"
] | null | null | null | import colorsys
import numpy as np
import cv2
GOLDEN_RATIO = 0.618033988749895
def draw_tracks(frame, tracks, show_flow=False, show_cov=False):
for track in tracks:
draw_bbox(frame, track.tlbr, get_color(track.trk_id), 2, str(track.trk_id))
if show_flow:
draw_feature_match(frame, tra... | 37.457364 | 95 | 0.627276 | import colorsys
import numpy as np
import cv2
GOLDEN_RATIO = 0.618033988749895
def draw_tracks(frame, tracks, show_flow=False, show_cov=False):
for track in tracks:
draw_bbox(frame, track.tlbr, get_color(track.trk_id), 2, str(track.trk_id))
if show_flow:
draw_feature_match(frame, tra... | true | true |
1c4591a6e22722c8a1760289f625d852a5960577 | 2,354 | py | Python | tests/io/simple_process.py | rajgiriUW/pyUSID | 064dcd81d9c42f4eb4782f0a41fd437b3f56f50c | [
"MIT"
] | 25 | 2018-07-11T21:43:56.000Z | 2021-11-17T11:40:00.000Z | tests/io/simple_process.py | rajgiriUW/pyUSID | 064dcd81d9c42f4eb4782f0a41fd437b3f56f50c | [
"MIT"
] | 62 | 2018-07-05T20:28:52.000Z | 2021-12-14T09:49:35.000Z | tests/io/simple_process.py | rajgiriUW/pyUSID | 064dcd81d9c42f4eb4782f0a41fd437b3f56f50c | [
"MIT"
] | 15 | 2019-03-27T22:28:47.000Z | 2021-01-03T20:23:42.000Z | """
Simple process class for purpose of testing.
Created on: Jul 19, 2019
Author: Emily Costa
"""
import h5py
from pyUSID.processing.process import Process
import numpy as np
from pyUSID import hdf_utils
import matplotlib.pyplot as plt
class SimpleProcess(Process):
def __init__(self, h5_main, verbose=True, **kwar... | 39.898305 | 149 | 0.666525 |
import h5py
from pyUSID.processing.process import Process
import numpy as np
from pyUSID import hdf_utils
import matplotlib.pyplot as plt
class SimpleProcess(Process):
def __init__(self, h5_main, verbose=True, **kwargs):
super(SimpleProcess, self).__init__(h5_main, verbose, **kwargs)
self.data = N... | true | true |
1c4591b85ef0cb783c72ba1b6a6beb97dbfb0aa3 | 2,482 | py | Python | pysnmp/CISCO-SCTP-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CISCO-SCTP-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CISCO-SCTP-CAPABILITY.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-SCTP-CAPABILITY (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-SCTP-CAPABILITY
# Produced by pysmi-0.3.4 at Mon Apr 29 17:54:50 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | 99.28 | 477 | 0.787671 |
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuild... | true | true |
1c45922460b3274c214c472b39912156f5a9ae77 | 1,632 | py | Python | game/startMk2.py | Penniling/launchpad-dont-choose-the-wrong | 490e814a531168ae3b4cbbd0db89a9887b5d0bb3 | [
"MIT"
] | null | null | null | game/startMk2.py | Penniling/launchpad-dont-choose-the-wrong | 490e814a531168ae3b4cbbd0db89a9887b5d0bb3 | [
"MIT"
] | null | null | null | game/startMk2.py | Penniling/launchpad-dont-choose-the-wrong | 490e814a531168ae3b4cbbd0db89a9887b5d0bb3 | [
"MIT"
] | null | null | null | import LaunchpadMk2
import atexit
import os
import random
def on_exit():
os.system(f"python {os.getcwd()}/startMk2.py")
class Game:
def __init__(self):
self.n = int(input("Please choose a number of wrong pads: "))
self.lp = LaunchpadMk2.LaunchpadMk2()
self.lp.Reset()
self.lp.... | 26.754098 | 89 | 0.550858 | import LaunchpadMk2
import atexit
import os
import random
def on_exit():
os.system(f"python {os.getcwd()}/startMk2.py")
class Game:
def __init__(self):
self.n = int(input("Please choose a number of wrong pads: "))
self.lp = LaunchpadMk2.LaunchpadMk2()
self.lp.Reset()
self.lp.... | true | true |
1c4592dbfd3957588d06fd935ce4c485dc1377a0 | 7,268 | py | Python | pennylane/interfaces/batch/tensorflow.py | ral9000/pennylane | 0afbd155d044730af546c6d90cef9d01f931632d | [
"Apache-2.0"
] | 712 | 2020-07-29T03:46:52.000Z | 2022-03-27T11:21:51.000Z | pennylane/interfaces/batch/tensorflow.py | ral9000/pennylane | 0afbd155d044730af546c6d90cef9d01f931632d | [
"Apache-2.0"
] | 1,627 | 2020-07-28T13:07:58.000Z | 2022-03-31T21:47:29.000Z | pennylane/interfaces/batch/tensorflow.py | ral9000/pennylane | 0afbd155d044730af546c6d90cef9d01f931632d | [
"Apache-2.0"
] | 249 | 2020-07-29T03:26:18.000Z | 2022-03-31T19:59:48.000Z | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicabl... | 43.261905 | 100 | 0.569895 |
import numpy as np
import tensorflow as tf
from tensorflow.python.eager import context
import pennylane as qml
def _compute_vjp(dy, jacs):
vjps = []
for d, jac in zip(dy, jacs):
vjp = qml.gradients.compute_vjp(d, jac)
if not context.executing_eagerly(... | true | true |
1c459309ba1a81398fc095a2ca8f6f6f4053e120 | 990 | py | Python | linkv_sdk/config/bindings/ffi.py | linkv-io/python2-sdk | 45699372ffcf6e3e745d870cfca004fc885ee15f | [
"Apache-2.0"
] | null | null | null | linkv_sdk/config/bindings/ffi.py | linkv-io/python2-sdk | 45699372ffcf6e3e745d870cfca004fc885ee15f | [
"Apache-2.0"
] | null | null | null | linkv_sdk/config/bindings/ffi.py | linkv-io/python2-sdk | 45699372ffcf6e3e745d870cfca004fc885ee15f | [
"Apache-2.0"
] | null | null | null | # -*- coding: UTF-8 -*-
import platform
import os
from requests import get
from tempfile import gettempdir
from ctypes import CDLL
def _platform_file(name):
ext = ''
if platform.uname()[0] == "Linux":
ext = 'so'
elif platform.uname()[0] == "Darwin":
ext = 'dylib'
elif platform.uname(... | 22 | 91 | 0.611111 |
import platform
import os
from requests import get
from tempfile import gettempdir
from ctypes import CDLL
def _platform_file(name):
ext = ''
if platform.uname()[0] == "Linux":
ext = 'so'
elif platform.uname()[0] == "Darwin":
ext = 'dylib'
elif platform.uname()[0] == "Windows":
... | true | true |
1c4595dae899b6160a00fb35d2139755cf007c2b | 2,254 | py | Python | backend/pyrogram/raw/functions/messages/get_attached_stickers.py | appheap/social-media-analyzer | 0f9da098bfb0b4f9eb38e0244aa3a168cf97d51c | [
"Apache-2.0"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/raw/functions/messages/get_attached_stickers.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/raw/functions/messages/get_attached_stickers.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.305556 | 103 | 0.645519 |
from io import BytesIO
from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
from pyrogram.raw.core import TLObject
from pyrogram import raw
from typing import List, Union, Any
| true | true |
1c459686e0c6196509dccaf4fcbecf5fdc393fc7 | 41,713 | py | Python | xform/models.py | alisonamerico/Django-XForm | ad2e96455307b57ef3c485a006db478fe4352a36 | [
"MIT"
] | 3 | 2019-07-25T14:46:14.000Z | 2020-12-14T22:43:46.000Z | xform/models.py | alisonamerico/Django-XForm | ad2e96455307b57ef3c485a006db478fe4352a36 | [
"MIT"
] | 4 | 2019-09-04T17:39:04.000Z | 2021-11-05T23:14:58.000Z | xform/models.py | alisonamerico/Django-XForm | ad2e96455307b57ef3c485a006db478fe4352a36 | [
"MIT"
] | 1 | 2021-11-05T23:05:48.000Z | 2021-11-05T23:05:48.000Z | import csv
import json
import mimetypes
import os
import random
import re
import requests
import xlrd
from contextlib import closing
from hashlib import md5
from io import BytesIO
from io import StringIO
from pyxform import SurveyElementBuilder
from pyxform.builder import create_survey_element_from_dict
from pyxfor... | 34.818865 | 96 | 0.601995 | import csv
import json
import mimetypes
import os
import random
import re
import requests
import xlrd
from contextlib import closing
from hashlib import md5
from io import BytesIO
from io import StringIO
from pyxform import SurveyElementBuilder
from pyxform.builder import create_survey_element_from_dict
from pyxfor... | true | true |
1c459720c843885a8386143a876fd1904e17dd73 | 3,345 | py | Python | leaderboard_service/leaderboard_service/settings.py | AVatch/leaderboard-service | 9b70e24866fe862ba5d71dc3404e123303325431 | [
"Apache-2.0"
] | 1 | 2016-02-25T22:50:22.000Z | 2016-02-25T22:50:22.000Z | leaderboard_service/leaderboard_service/settings.py | AVatch/leaderboard-service | 9b70e24866fe862ba5d71dc3404e123303325431 | [
"Apache-2.0"
] | null | null | null | leaderboard_service/leaderboard_service/settings.py | AVatch/leaderboard-service | 9b70e24866fe862ba5d71dc3404e123303325431 | [
"Apache-2.0"
] | null | null | null | """
Django settings for leaderboard_service project.
Generated by 'django-admin startproject' using Django 1.9.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
... | 26.338583 | 91 | 0.704933 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'y(9k(&i#f11*to()nc^qy9nnokkwg^d(7g1zk9^p8%4!@cz)td'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
CORE_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
1c459747e39517110330c01929492f60ac06c5aa | 503 | py | Python | vqseg/wordseg_algorithms.py | janinerugayan/VectorQuantizedCPC | b4e9fe6aeebca3b792ab604a770e8c3e289a46a1 | [
"MIT"
] | null | null | null | vqseg/wordseg_algorithms.py | janinerugayan/VectorQuantizedCPC | b4e9fe6aeebca3b792ab604a770e8c3e289a46a1 | [
"MIT"
] | null | null | null | vqseg/wordseg_algorithms.py | janinerugayan/VectorQuantizedCPC | b4e9fe6aeebca3b792ab604a770e8c3e289a46a1 | [
"MIT"
] | null | null | null | """
Word segmentation algorithms.
Author: Herman Kamper
Contact: kamperh@gmail.com
Date: 2020
"""
from wordseg.algos import tp, puddle, dpseg, baseline, dibs, ag
import wordseg.algos
def ag(utterance_list, **kwargs):
return list(wordseg.algos.ag.segment(utterance_list, **kwargs))
def tp(utterance_list, **kwar... | 21.869565 | 70 | 0.745527 |
from wordseg.algos import tp, puddle, dpseg, baseline, dibs, ag
import wordseg.algos
def ag(utterance_list, **kwargs):
return list(wordseg.algos.ag.segment(utterance_list, **kwargs))
def tp(utterance_list, **kwargs):
return list(wordseg.algos.tp.segment(utterance_list, **kwargs))
def dpseg(utterance_list... | true | true |
1c45984c4c6ee38da52bda0420ddc998d5a7f5a2 | 2,024 | py | Python | tests/test_git.py | igorbernstein2/synthtool | 6b33cffb4301c3f05cc6976fff0022d98b47772f | [
"Apache-2.0"
] | null | null | null | tests/test_git.py | igorbernstein2/synthtool | 6b33cffb4301c3f05cc6976fff0022d98b47772f | [
"Apache-2.0"
] | null | null | null | tests/test_git.py | igorbernstein2/synthtool | 6b33cffb4301c3f05cc6976fff0022d98b47772f | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 28.914286 | 88 | 0.6917 |
from unittest import mock
import pytest
from synthtool.sources import git
def test_make_repo_clone_url(monkeypatch):
monkeypatch.setattr(git, "USE_SSH", True)
assert (
git.make_repo_clone_url("theacodes/nox") == "git@github.com:theacodes/nox.git"
)
def test_make_repo_clone_url_ht... | true | true |
1c45988afdd14740a571c6b781a72451a6d25636 | 3,162 | py | Python | dispel4py/seismo/obspy_stream.py | AndreiFrunze/wrangler | 076a07de00fc966dcf18ca6b6a6e804be5245ed9 | [
"Apache-2.0"
] | 2 | 2017-09-07T04:33:18.000Z | 2019-01-07T13:32:15.000Z | dispel4py/seismo/obspy_stream.py | AndreiFrunze/wrangler | 076a07de00fc966dcf18ca6b6a6e804be5245ed9 | [
"Apache-2.0"
] | 2 | 2016-10-06T13:07:05.000Z | 2017-12-20T09:47:08.000Z | dispel4py/seismo/obspy_stream.py | AndreiFrunze/wrangler | 076a07de00fc966dcf18ca6b6a6e804be5245ed9 | [
"Apache-2.0"
] | 5 | 2016-09-01T08:38:20.000Z | 2018-08-28T12:08:39.000Z | from dispel4py.seismo.seismo import SeismoPE
import traceback
INPUT_NAME = 'input'
OUTPUT_NAME = 'output'
class ObspyStreamPE(SeismoPE):
'''
A SeismoPE that calls a function to process an input stream.
'''
def __init__(self):
SeismoPE.__init__(self)
def setCompute(self, compute_f... | 34.747253 | 141 | 0.624921 | from dispel4py.seismo.seismo import SeismoPE
import traceback
INPUT_NAME = 'input'
OUTPUT_NAME = 'output'
class ObspyStreamPE(SeismoPE):
def __init__(self):
SeismoPE.__init__(self)
def setCompute(self, compute_fn, params={}):
self.compute_fn = compute_fn, dict(params)
de... | true | true |
1c4598e6f314bfee7c1a31680ad93afaa47b3067 | 4,132 | py | Python | plugins/samanage/komand_samanage/actions/list_users/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/samanage/komand_samanage/actions/list_users/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/samanage/komand_samanage/actions/list_users/action.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | import komand
from .schema import ListUsersInput, ListUsersOutput
# Custom imports below
class ListUsers(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="list_users",
description="List all users",
input=ListUsersInput(),
outpu... | 41.32 | 100 | 0.393272 | import komand
from .schema import ListUsersInput, ListUsersOutput
class ListUsers(komand.Action):
def __init__(self):
super(self.__class__, self).__init__(
name="list_users",
description="List all users",
input=ListUsersInput(),
output=ListUsersOutput(),
... | true | true |
1c4598f31962fb4914c01183dfd2b5367f20731a | 136 | py | Python | al_phonebook/types.py | vtrvtr/al_phonebook | 7bcdb7fa0323c873c523036da99b4b1616c0e00e | [
"MIT"
] | null | null | null | al_phonebook/types.py | vtrvtr/al_phonebook | 7bcdb7fa0323c873c523036da99b4b1616c0e00e | [
"MIT"
] | 1 | 2022-01-17T14:45:50.000Z | 2022-01-17T14:45:51.000Z | al_phonebook/types.py | vtrvtr/al_phonebook | 7bcdb7fa0323c873c523036da99b4b1616c0e00e | [
"MIT"
] | null | null | null | from typing import Any, Union
import os
DictItem = dict[str, Any]
OptionalDictItem = DictItem | None
PathLike = Union[os.PathLike, str] | 22.666667 | 34 | 0.764706 | from typing import Any, Union
import os
DictItem = dict[str, Any]
OptionalDictItem = DictItem | None
PathLike = Union[os.PathLike, str] | true | true |
1c459b1eb973ce00d988425faa2a536d4bd861cd | 744 | py | Python | dm_control/composer/constants.py | h8907283/dm_control | fe4449606742a7b8bec81930790b98244cddc538 | [
"Apache-2.0"
] | 2,863 | 2018-01-03T01:38:52.000Z | 2022-03-30T09:49:50.000Z | dm_control/composer/constants.py | krakhit/dm_control | 4e1a35595124742015ae0c7a829e099a5aa100f5 | [
"Apache-2.0"
] | 266 | 2018-01-03T16:00:04.000Z | 2022-03-26T15:45:48.000Z | dm_control/composer/constants.py | krakhit/dm_control | 4e1a35595124742015ae0c7a829e099a5aa100f5 | [
"Apache-2.0"
] | 580 | 2018-01-03T03:17:27.000Z | 2022-03-31T19:29:32.000Z | # Copyright 2018 The dm_control 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 agreed to i... | 37.2 | 78 | 0.681452 |
SENSOR_SITES_GROUP = 4
| true | true |
1c459b5a3be59498565c981523bb698670abd0ef | 255 | py | Python | manage.py | justsostephen/track | b1749f7db664d76fab0c501c23f0d0705cc95fce | [
"MIT"
] | null | null | null | manage.py | justsostephen/track | b1749f7db664d76fab0c501c23f0d0705cc95fce | [
"MIT"
] | null | null | null | manage.py | justsostephen/track | b1749f7db664d76fab0c501c23f0d0705cc95fce | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stockcontrol.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23.181818 | 76 | 0.776471 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stockcontrol.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
1c459b9e9ba258120e841df624eb7641c3121e90 | 4,297 | py | Python | aiograph/utils/html.py | fakegit/aiograph | a00aacebb04c1e743055ba524b978a06027e31ed | [
"MIT"
] | 45 | 2018-05-05T12:31:43.000Z | 2022-03-23T11:20:03.000Z | aiographfix/utils/html.py | Yyonging/aiograph | 78d291f9e1157720c949e336a9aa2711ad707285 | [
"MIT"
] | 6 | 2019-03-04T11:23:49.000Z | 2022-03-30T11:25:46.000Z | aiographfix/utils/html.py | Yyonging/aiograph | 78d291f9e1157720c949e336a9aa2711ad707285 | [
"MIT"
] | 16 | 2019-02-22T19:10:19.000Z | 2021-09-15T22:12:55.000Z | from html import escape
from html.entities import name2codepoint
from html.parser import HTMLParser
from typing import List, Union
import attr
from ..types import NodeElement
ALLOWED_TAGS = [
'a', 'aside', 'b', 'blockquote', 'br', 'code', 'em', 'figcaption', 'figure',
'h3', 'h4', 'hr', 'i', 'iframe', 'img', ... | 25.577381 | 89 | 0.594601 | from html import escape
from html.entities import name2codepoint
from html.parser import HTMLParser
from typing import List, Union
import attr
from ..types import NodeElement
ALLOWED_TAGS = [
'a', 'aside', 'b', 'blockquote', 'br', 'code', 'em', 'figcaption', 'figure',
'h3', 'h4', 'hr', 'i', 'iframe', 'img', ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.