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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f71167e5a3698413e13abeed3d48c71b338681ad | 191 | py | Python | web/app/djrq/model/prokyon/album_view.py | bmillham/djrq2 | c84283b75a7c15da1902ebfc32b7d75159c09e20 | [
"MIT"
] | 1 | 2016-11-23T20:50:00.000Z | 2016-11-23T20:50:00.000Z | web/app/djrq/model/prokyon/album_view.py | bmillham/djrq2 | c84283b75a7c15da1902ebfc32b7d75159c09e20 | [
"MIT"
] | 15 | 2017-01-15T04:18:40.000Z | 2017-02-25T04:13:06.000Z | web/app/djrq/model/prokyon/album_view.py | bmillham/djrq2 | c84283b75a7c15da1902ebfc32b7d75159c09e20 | [
"MIT"
] | null | null | null | from . import *
class Album(Base):
__tablename__ = "album_view"
id = Column(Integer, primary_key=True)
fullname = Column(Text)
name = Column(Text)
prefix = Column(Text)
| 19.1 | 42 | 0.65445 | from . import *
class Album(Base):
__tablename__ = "album_view"
id = Column(Integer, primary_key=True)
fullname = Column(Text)
name = Column(Text)
prefix = Column(Text)
| true | true |
f7116863995bc72b2db542ec2e1f8ca284bc4257 | 758 | py | Python | leetcode/python/easy/p1169_invalidTransactions.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null | leetcode/python/easy/p1169_invalidTransactions.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null | leetcode/python/easy/p1169_invalidTransactions.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null | class Solution:
def invalidTransactions(self, transactions):
helper = []
helper_back = []
for transaction in transactions:
tmp_transaction = transaction.split(",")
helper.append(tmp_transaction)
for record in helper:
if int(record[2]) > 1000:
... | 34.454545 | 121 | 0.546174 | class Solution:
def invalidTransactions(self, transactions):
helper = []
helper_back = []
for transaction in transactions:
tmp_transaction = transaction.split(",")
helper.append(tmp_transaction)
for record in helper:
if int(record[2]) > 1000:
... | true | true |
f711693db6db8e214c62c061ee3ce205f8f0b101 | 5,413 | py | Python | tests/pipelines/test_distillation.py | gr33n-made/catalyst | bd413abc908ef7cbdeab42b0e805277a791e3ddb | [
"Apache-2.0"
] | 1 | 2021-09-29T20:30:50.000Z | 2021-09-29T20:30:50.000Z | tests/pipelines/test_distillation.py | gr33n-made/catalyst | bd413abc908ef7cbdeab42b0e805277a791e3ddb | [
"Apache-2.0"
] | null | null | null | tests/pipelines/test_distillation.py | gr33n-made/catalyst | bd413abc908ef7cbdeab42b0e805277a791e3ddb | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
import os
from tempfile import TemporaryDirectory
from pytest import mark
import torch
from torch import nn, optim
from torch.nn import functional as F
from torch.utils.data import DataLoader
from catalyst import dl
from catalyst.contrib.datasets import MNIST
from catalyst.data import ToTensor
from ca... | 30.931429 | 99 | 0.619435 |
import os
from tempfile import TemporaryDirectory
from pytest import mark
import torch
from torch import nn, optim
from torch.nn import functional as F
from torch.utils.data import DataLoader
from catalyst import dl
from catalyst.contrib.datasets import MNIST
from catalyst.data import ToTensor
from catalyst.setting... | true | true |
f71169a59355addf79f185e4ad592858c30dd011 | 576 | py | Python | Data_Science/lesson_2/api_quiz/api_quiz_solution.py | napjon/moocs_solution | 5c96f43f6cb2ae643f482580446869953a99beb6 | [
"MIT"
] | 13 | 2016-04-29T07:21:44.000Z | 2021-09-29T03:20:51.000Z | Data_Science/lesson_2/api_quiz/api_quiz_solution.py | napjon/moocs_solution | 5c96f43f6cb2ae643f482580446869953a99beb6 | [
"MIT"
] | 1 | 2017-02-07T07:37:20.000Z | 2017-02-19T08:37:17.000Z | Data_Science/lesson_2/api_quiz/api_quiz_solution.py | napjon/moocs_solution | 5c96f43f6cb2ae643f482580446869953a99beb6 | [
"MIT"
] | 13 | 2016-01-25T03:23:57.000Z | 2019-10-13T15:29:23.000Z | import json
import requests
import pprint
def api_get_request(url):
# In this exercise, you want to call the last.fm API to get a list of the
# top artists in Spain.
#
# Once you've done this, return the name of the number 1 top artist in Spain.
data = requests.get(url).text
data = json.loads(d... | 30.315789 | 81 | 0.671875 | import json
import requests
import pprint
def api_get_request(url):
data = requests.get(url).text
data = json.loads(data)
#country_data = data['country']
pp = pprint.PrettyPrinter(depth = 4)
#pp.pprint(data)
top_artists = data['topartists']['artist']
#[e['name'] for e in... | true | true |
f71169dddfc98800a555c6b84c121cbb3c2501e0 | 580 | py | Python | tests/integration/models/test_group.py | beanpuppy/infynipy | 585e8734a6c3ed69c2a78d52a394a71303bcc88b | [
"MIT"
] | null | null | null | tests/integration/models/test_group.py | beanpuppy/infynipy | 585e8734a6c3ed69c2a78d52a394a71303bcc88b | [
"MIT"
] | null | null | null | tests/integration/models/test_group.py | beanpuppy/infynipy | 585e8734a6c3ed69c2a78d52a394a71303bcc88b | [
"MIT"
] | null | null | null | from infynipy.models.group import ReferrerGroup
from .. import IntegrationTest, vcrr
class TestReferrerGroup(IntegrationTest):
@vcrr.use_cassette
def test_referrer_group_get_multiple(self):
for group in self.infynity.referrer_groups:
assert isinstance(group, ReferrerGroup)
@vcrr.use_... | 27.619048 | 67 | 0.682759 | from infynipy.models.group import ReferrerGroup
from .. import IntegrationTest, vcrr
class TestReferrerGroup(IntegrationTest):
@vcrr.use_cassette
def test_referrer_group_get_multiple(self):
for group in self.infynity.referrer_groups:
assert isinstance(group, ReferrerGroup)
@vcrr.use_... | true | true |
f7116afc9150f85440d20e85f7548abaa8191c95 | 7,494 | py | Python | official/nlp/modeling/networks/albert_encoder_test.py | mcasanova1445/models | 37be0fdb4abccca633bb3199a4e6f3f71cd174d9 | [
"Apache-2.0"
] | 1 | 2020-09-14T10:46:07.000Z | 2020-09-14T10:46:07.000Z | official/nlp/modeling/networks/albert_encoder_test.py | mdsaifhaider/models | 7214e17eb425963ec3d0295be215d5d26deaeb32 | [
"Apache-2.0"
] | 8 | 2020-05-19T00:52:30.000Z | 2020-06-04T23:57:20.000Z | official/nlp/modeling/networks/albert_encoder_test.py | mdsaifhaider/models | 7214e17eb425963ec3d0295be215d5d26deaeb32 | [
"Apache-2.0"
] | 2 | 2021-10-07T04:47:04.000Z | 2021-12-18T04:18:19.000Z | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.650794 | 101 | 0.72538 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
import tensorflow as tf
from tensorflow.python.keras import keras_parameterized
from official.nlp.modeling.networks import albert_enco... | true | true |
f7116afe35be171ca7613c0d3c649949f5a75deb | 5,513 | py | Python | RaspberryPi/ble_lights.py | ippie52/BLE-Tutor | df4fae208d289e988955182c356040243365f66d | [
"MIT"
] | null | null | null | RaspberryPi/ble_lights.py | ippie52/BLE-Tutor | df4fae208d289e988955182c356040243365f66d | [
"MIT"
] | null | null | null | RaspberryPi/ble_lights.py | ippie52/BLE-Tutor | df4fae208d289e988955182c356040243365f66d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# ------------------------------------------------------------------------------
"""@package ble_lights.py
Sets the attached light values and notifies when they change.
"""
# ------------------------------------------------------------------------------
# Kris Dunning ippie52@gmail.... | 29.015789 | 81 | 0.573372 |
import pybleno as ble
import wiringpi
from typing import Dict
from sys import exit
from time import sleep
from colour_printer import ColourPrinter
class KrisCharacteristic(ColourPrinter, ble.Characteristic):
def __init__(self, settings: Dict[str, any], name: str, colour: str) -> None:
ble.Characterist... | true | true |
f7116b42fc8b5931f1f34af5460f82cc8a0e789a | 7,049 | py | Python | graphql_compiler/compiler/ir_lowering_match/__init__.py | jb-kensho/graphql-compiler | 4511793281698bd55e63fd7a3f25f9cb094084d4 | [
"Apache-2.0"
] | null | null | null | graphql_compiler/compiler/ir_lowering_match/__init__.py | jb-kensho/graphql-compiler | 4511793281698bd55e63fd7a3f25f9cb094084d4 | [
"Apache-2.0"
] | 1 | 2019-04-18T18:23:16.000Z | 2019-04-18T18:23:16.000Z | graphql_compiler/compiler/ir_lowering_match/__init__.py | jb-kensho/graphql-compiler | 4511793281698bd55e63fd7a3f25f9cb094084d4 | [
"Apache-2.0"
] | 1 | 2019-11-21T02:38:27.000Z | 2019-11-21T02:38:27.000Z | # Copyright 2018-present Kensho Technologies, LLC.
import six
from ..blocks import Filter, GlobalOperationsStart
from ..ir_lowering_common import (extract_optional_location_root_info,
extract_simple_optional_location_info,
lower_context_field_existenc... | 54.643411 | 99 | 0.709037 |
import six
from ..blocks import Filter, GlobalOperationsStart
from ..ir_lowering_common import (extract_optional_location_root_info,
extract_simple_optional_location_info,
lower_context_field_existence, merge_consecutive_filter_clauses,
... | true | true |
f7116c404797f3847bdb182bff01976965d6e485 | 63,967 | py | Python | src/sage/schemes/elliptic_curves/padic_lseries.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/schemes/elliptic_curves/padic_lseries.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/schemes/elliptic_curves/padic_lseries.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 1 | 2020-07-23T10:29:58.000Z | 2020-07-23T10:29:58.000Z | # -*- coding: utf-8 -*-
r"""
`p`-adic `L`-functions of elliptic curves
To an elliptic curve `E` over the rational numbers and a prime `p`, one
can associate a `p`-adic L-function; at least if `E` does not have additive
reduction at `p`. This function is defined by interpolation of L-values of `E`
at twists. Through th... | 37.429491 | 206 | 0.51783 |
self, '_modular_symbol_negative'):
self.__add_negative_space()
f = self._negative_modular_symbol
self.__measure_data[(n, prec, s)] = (p, alpha, z, w, f)
if quadratic_twist == 1:
if self._E.conductor() % p == 0:
return z *... | true | true |
f7116ca368bdcdd42239a17f140dbe141d3d445c | 2,085 | py | Python | codeMarkDown/MD_Link.py | atria-tools/monk | 4961457f4db5dfa98fc6001a289c24e460e5b025 | [
"Apache-2.0"
] | null | null | null | codeMarkDown/MD_Link.py | atria-tools/monk | 4961457f4db5dfa98fc6001a289c24e460e5b025 | [
"Apache-2.0"
] | 1 | 2015-03-22T12:37:18.000Z | 2015-03-22T12:37:18.000Z | codeMarkDown/MD_Link.py | HeeroYui/monk | 4961457f4db5dfa98fc6001a289c24e460e5b025 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import monkDebug as debug
import sys
import monkTools
import re
##
## @brief Transcode:
## [http://votre_site.con] => http://votre_site.con
## [http://votre_site.con | text displayed] => text displayed
## [http://votre_site.con text displayed] => text displayed.
##
## @param[in] value String to tra... | 24.529412 | 67 | 0.490647 |
import monkDebug as debug
import sys
import monkTools
import re
value)
value = re.sub(r'\[lib\[(.*?) \| (.*?)\]\]',
r'<a href="../\1">\2</a>',
value)
value = re.sub(r'\[doc\[(.*?) \| (.*?)\]\]',
r'<a href="\1.html">\2</a>',
value)
... | true | true |
f7116e8e419ef38b1a22603a973c53b8ef2a6045 | 9,085 | py | Python | karesansui/lib/parser/collectdplugin.py | Kairiw/karesansui | d5a3acfe40b3953fb4f8d6f51e30d0307309a6ee | [
"MIT"
] | null | null | null | karesansui/lib/parser/collectdplugin.py | Kairiw/karesansui | d5a3acfe40b3953fb4f8d6f51e30d0307309a6ee | [
"MIT"
] | null | null | null | karesansui/lib/parser/collectdplugin.py | Kairiw/karesansui | d5a3acfe40b3953fb4f8d6f51e30d0307309a6ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Karesansui Core.
#
# Copyright (C) 2009-2012 HDE, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restric... | 37.697095 | 155 | 0.612438 |
import os
import re
import sys
import glob
from karesansui.lib.dict_op import DictOp
from karesansui.lib.parser.base.xml_like_conf_parser import xmlLikeConfParser as Parser
from karesansui.lib.utils import preprint_r, r_chgrp, r_chmod
from karesansui.lib.const import VENDOR_SYSCONF_DIR, \
... | true | true |
f7116ee3a17fcb6b15670369732a0331101ec14b | 13,492 | py | Python | inv/models/interfaceclassificationrule.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | inv/models/interfaceclassificationrule.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | inv/models/interfaceclassificationrule.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# Interface Classification Rules models
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ------------------------------------------------------------------... | 39.335277 | 115 | 0.505633 |
import re
from mongoengine.document import Document, EmbeddedDocument
from mongoengine.fields import StringField, IntField, ListField, EmbeddedDocumentField, BooleanField
from noc.core.mongo.fields import ForeignKeyField, PlainReferenceField
from noc.core.ip import IP
from noc.main.models.prefixtable import... | true | true |
f7116f15bfecc8ac518a725732046cefe35eea97 | 2,520 | py | Python | configs/opamp/biased_pmos_gain/15-layer-ft-all-pool-0.5/config.py | kouroshHakha/circuit-fewshot-code | 32007e119da30632736868a3f643027624bf08d2 | [
"BSD-3-Clause"
] | null | null | null | configs/opamp/biased_pmos_gain/15-layer-ft-all-pool-0.5/config.py | kouroshHakha/circuit-fewshot-code | 32007e119da30632736868a3f643027624bf08d2 | [
"BSD-3-Clause"
] | null | null | null | configs/opamp/biased_pmos_gain/15-layer-ft-all-pool-0.5/config.py | kouroshHakha/circuit-fewshot-code | 32007e119da30632736868a3f643027624bf08d2 | [
"BSD-3-Clause"
] | null | null | null | import time
import hashlib
import torch
from torch_geometric.data import DataLoader
from cgl.utils.params import ParamDict
from cgl.data.graph_data import CircuitInMemDataset, CircuitGraphDataset
# from cgl.models.gnn import DeepGENNet
s = time.time()
print('Loading the dataset ...')
root = '/store/nosnap/results/n... | 32.727273 | 133 | 0.749603 | import time
import hashlib
import torch
from torch_geometric.data import DataLoader
from cgl.utils.params import ParamDict
from cgl.data.graph_data import CircuitInMemDataset, CircuitGraphDataset
s = time.time()
print('Loading the dataset ...')
root = '/store/nosnap/results/ngspice_biased_pmos_gain/two_stage_biase... | true | true |
f7116fb8eeb110ebf0028104837ae9b3e293cbef | 27,964 | py | Python | pandapower/plotting/plotly/traces.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | null | null | null | pandapower/plotting/plotly/traces.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | null | null | null | pandapower/plotting/plotly/traces.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2019 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import math
import numpy as np
import pandas as pd
from packaging import version
from collections.abc import Iterable
from panda... | 41.737313 | 134 | 0.601738 |
import math
import numpy as np
import pandas as pd
from packaging import version
from collections.abc import Iterable
from pandapower.plotting.plotly.get_colors import get_plotly_color, get_plotly_cmap
from pandapower.plotting.plotly.mapbox_plot import _on_map_test, _get_mapbox_token, MapboxTokenMissing
try:
... | true | true |
f7116ff78296699e86d5db80a36bfce9887bbf28 | 41,747 | py | Python | lifelines/tests/utils/test_utils.py | stefan-de/lifelines | 519bd3abe6051bd9fb5da0dfffce24ab86171f3f | [
"MIT"
] | 1 | 2020-11-18T19:54:09.000Z | 2020-11-18T19:54:09.000Z | lifelines/tests/utils/test_utils.py | stefan-de/lifelines | 519bd3abe6051bd9fb5da0dfffce24ab86171f3f | [
"MIT"
] | null | null | null | lifelines/tests/utils/test_utils.py | stefan-de/lifelines | 519bd3abe6051bd9fb5da0dfffce24ab86171f3f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
import os
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal, assert_series_equal
import numpy.testing as npt
from numpy.linalg import norm, lstsq
from numpy.random import randn
from flaky import flaky
from lifelines import CoxPHFitter, WeibullA... | 37.917348 | 130 | 0.599612 |
import pytest
import os
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal, assert_series_equal
import numpy.testing as npt
from numpy.linalg import norm, lstsq
from numpy.random import randn
from flaky import flaky
from lifelines import CoxPHFitter, WeibullAFTFitter, KaplanMeierFi... | true | true |
f7117002249c5cd4e3d455a21d49ac1b75cdb790 | 21,672 | py | Python | install/tools/script/common/project_utils.py | atframework/atsf4g-co | 7323ccbbc238f7d653f92c8d2aa9079beb4ef09b | [
"MIT"
] | 68 | 2016-09-08T14:36:22.000Z | 2022-03-15T09:45:53.000Z | install/tools/script/common/project_utils.py | atframework/atsf4g-co | 7323ccbbc238f7d653f92c8d2aa9079beb4ef09b | [
"MIT"
] | 3 | 2019-06-09T10:27:23.000Z | 2021-09-09T07:55:37.000Z | install/tools/script/common/project_utils.py | atframework/atsf4g-co | 7323ccbbc238f7d653f92c8d2aa9079beb4ef09b | [
"MIT"
] | 24 | 2016-11-17T12:53:24.000Z | 2021-09-26T07:37:42.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import ctypes
import platform
import cgi
import re
import hashlib
import stat
import codecs
import common.print_color
environment_check_shm = None
global_opts = None
global_cahce = dict(id_offset=0, services_type=[])
server_opts = None
server_name = '... | 34.842444 | 125 | 0.656285 |
import sys
import os
import ctypes
import platform
import cgi
import re
import hashlib
import stat
import codecs
import common.print_color
environment_check_shm = None
global_opts = None
global_cahce = dict(id_offset=0, services_type=[])
server_opts = None
server_name = ''
server_index = 1
server_alloc_listen_port ... | true | true |
f7117058f8de1894f09859f44d2ac1935baabe07 | 6,301 | py | Python | src/char/trapsin.py | roozhou/botty | a67a87845687cdf6900af10a13dc7170684faa9a | [
"MIT"
] | null | null | null | src/char/trapsin.py | roozhou/botty | a67a87845687cdf6900af10a13dc7170684faa9a | [
"MIT"
] | null | null | null | src/char/trapsin.py | roozhou/botty | a67a87845687cdf6900af10a13dc7170684faa9a | [
"MIT"
] | null | null | null | import keyboard
from utils.custom_mouse import mouse
from char import IChar
from pather import Pather
from logger import Logger
from screen import convert_abs_to_monitor, convert_screen_to_abs, grab
from config import Config
from utils.misc import wait, rotate_vec, unit_vector
import random
from pather import Location,... | 43.455172 | 133 | 0.628948 | import keyboard
from utils.custom_mouse import mouse
from char import IChar
from pather import Pather
from logger import Logger
from screen import convert_abs_to_monitor, convert_screen_to_abs, grab
from config import Config
from utils.misc import wait, rotate_vec, unit_vector
import random
from pather import Location,... | true | true |
f7117441264ed44f4707d96e06ad13baddd008e2 | 6,635 | py | Python | models/IPCC/model.py | TD21forever/QoS-Predcition-Algorithm-library | f4503462887d719a39c9ccddd6cc55546e783fd5 | [
"MIT"
] | 2 | 2022-02-08T08:19:59.000Z | 2022-02-17T01:42:54.000Z | models/IPCC/model.py | TD21forever/QoS-Predcition-Algorithm-library | f4503462887d719a39c9ccddd6cc55546e783fd5 | [
"MIT"
] | null | null | null | models/IPCC/model.py | TD21forever/QoS-Predcition-Algorithm-library | f4503462887d719a39c9ccddd6cc55546e783fd5 | [
"MIT"
] | null | null | null | import copy
import math
import numpy as np
from tqdm import tqdm
from utils.model_util import triad_to_matrix, nonzero_user_mean, nonzero_item_mean
# 相似度计算库
from scipy.stats import pearsonr
from sklearn.metrics.pairwise import cosine_similarity
class IPCCModel(object):
def __init__(self) -> None:
super()... | 33.341709 | 82 | 0.508063 | import copy
import math
import numpy as np
from tqdm import tqdm
from utils.model_util import triad_to_matrix, nonzero_user_mean, nonzero_item_mean
from scipy.stats import pearsonr
from sklearn.metrics.pairwise import cosine_similarity
class IPCCModel(object):
def __init__(self) -> None:
super().__init_... | true | true |
f71174c8a63e501662fba38d43a6adaa7178d911 | 1,172 | py | Python | tests/date_class_test.py | MartinVardanyan/My-first-project-on-GitHub | 0bfef25b691362f797b990758cc0fd342b72e891 | [
"Apache-2.0"
] | null | null | null | tests/date_class_test.py | MartinVardanyan/My-first-project-on-GitHub | 0bfef25b691362f797b990758cc0fd342b72e891 | [
"Apache-2.0"
] | null | null | null | tests/date_class_test.py | MartinVardanyan/My-first-project-on-GitHub | 0bfef25b691362f797b990758cc0fd342b72e891 | [
"Apache-2.0"
] | null | null | null | from date_class import Date
def test_init_repr(day, month, year):
obj = Date(day, month, year)
print(obj)
def test_get_day(d, m, y):
obj = Date(d, m, y)
print(obj.get_day())
def test_set_day(d, m, y, day):
obj = Date(d, m, y)
obj.set_day(day)
print(obj)
def test_get_month(d, m, y):
... | 16.507042 | 46 | 0.587884 | from date_class import Date
def test_init_repr(day, month, year):
obj = Date(day, month, year)
print(obj)
def test_get_day(d, m, y):
obj = Date(d, m, y)
print(obj.get_day())
def test_set_day(d, m, y, day):
obj = Date(d, m, y)
obj.set_day(day)
print(obj)
def test_get_month(d, m, y):
... | true | true |
f711752191b86c47ba0c964c73a8a06f6a4265dd | 286 | py | Python | steelscript/netshark/core/_exceptions.py | riverbed/steelscript-netshark | a944f18ad79c775ab6c072924b0bbb613d7462d2 | [
"MIT"
] | null | null | null | steelscript/netshark/core/_exceptions.py | riverbed/steelscript-netshark | a944f18ad79c775ab6c072924b0bbb613d7462d2 | [
"MIT"
] | null | null | null | steelscript/netshark/core/_exceptions.py | riverbed/steelscript-netshark | a944f18ad79c775ab6c072924b0bbb613d7462d2 | [
"MIT"
] | 1 | 2019-03-20T01:47:50.000Z | 2019-03-20T01:47:50.000Z | # Copyright (c) 2015 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License"). This software is distributed "AS IS"
# as set forth in the License.
class NetSharkException(Exception):
pass
| 23.833333 | 78 | 0.748252 |
class NetSharkException(Exception):
pass
| true | true |
f711759e0907a6b1ed71c17303125fe06cbf6c66 | 26,496 | py | Python | EM_and_MD_answers_wc3.py | haddocking/MolMod-scripts | 604bdb05504c5b95a42e684b45b26f6306c856b9 | [
"Apache-2.0"
] | null | null | null | EM_and_MD_answers_wc3.py | haddocking/MolMod-scripts | 604bdb05504c5b95a42e684b45b26f6306c856b9 | [
"Apache-2.0"
] | null | null | null | EM_and_MD_answers_wc3.py | haddocking/MolMod-scripts | 604bdb05504c5b95a42e684b45b26f6306c856b9 | [
"Apache-2.0"
] | null | null | null | #!/usr/local/bin/python
#############################################################
# Simple MD of Lennard Jones charged or uncharged particles #
# Alexandre Bonvin, Aalt Jan van Dijk, Utrecht University #
# Updated to a singular script with a modern look by Douwe #
# Schulte, Utrecht University (2022) ... | 34.012837 | 232 | 0.629265 |
ord):
v0x=(coord[0]-old_coord[0])/(2*dtstep)
v0y=(coord[1]-old_coord[1])/(2*dtstep)
velocities.append([v0x,v0y])
return velocities
##########################
# Move particles with MD #
##########################
def simulate():
global Atom_Coord,Radius,Mass,BoxDim,Epsilon,Rmin,CutOf... | true | true |
f71176f4acbc961020e19a3b62348580e1cc273d | 1,242 | py | Python | setup.py | parlarjb/github-cli | c5b4166976bbf94fc3f929cc369ce094bc02b88e | [
"BSD-3-Clause"
] | 2 | 2016-05-09T15:32:35.000Z | 2016-07-19T11:39:21.000Z | setup.py | parlarjb/github-cli | c5b4166976bbf94fc3f929cc369ce094bc02b88e | [
"BSD-3-Clause"
] | null | null | null | setup.py | parlarjb/github-cli | c5b4166976bbf94fc3f929cc369ce094bc02b88e | [
"BSD-3-Clause"
] | null | null | null | import os
from setuptools import setup, find_packages
version = '0.2.5.2'
description = "A command-line interface to the GitHub Issues API v2."
cur_dir = os.path.dirname(__file__)
try:
long_description = open(os.path.join(cur_dir, 'README.rst')).read()
except:
long_description = description
setup(
name =... | 28.883721 | 71 | 0.633655 | import os
from setuptools import setup, find_packages
version = '0.2.5.2'
description = "A command-line interface to the GitHub Issues API v2."
cur_dir = os.path.dirname(__file__)
try:
long_description = open(os.path.join(cur_dir, 'README.rst')).read()
except:
long_description = description
setup(
name =... | true | true |
f711771424da5145f12842b6f940f779e986d6f7 | 385 | py | Python | customer/migrations/0002_ordermodel_is_shipped.py | rishav142k/deliver-app | 89905c7341fdf17d124aec5042e2ff90ddd455e8 | [
"Unlicense",
"MIT"
] | null | null | null | customer/migrations/0002_ordermodel_is_shipped.py | rishav142k/deliver-app | 89905c7341fdf17d124aec5042e2ff90ddd455e8 | [
"Unlicense",
"MIT"
] | null | null | null | customer/migrations/0002_ordermodel_is_shipped.py | rishav142k/deliver-app | 89905c7341fdf17d124aec5042e2ff90ddd455e8 | [
"Unlicense",
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-04 04:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('customer', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='ordermodel',
name='is_shipped',
... | 20.263158 | 53 | 0.597403 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('customer', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='ordermodel',
name='is_shipped',
field=models.BooleanField(default=False),... | true | true |
f711775130951f9f56a2eb5a79b1c5e85a13ea77 | 2,614 | py | Python | var/spack/repos/builtin/packages/dftfe/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/dftfe/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/dftfe/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Dftfe(CMakePackage):
"""Real-space DFT calculations using Finite Elements"""
homepage ... | 39.606061 | 123 | 0.65417 |
from spack import *
class Dftfe(CMakePackage):
homepage = "https://sites.google.com/umich.edu/dftfe/"
url = "https://github.com/dftfeDevelopers/dftfe/archive/0.5.1.tar.gz"
maintainers = ['rmsds']
version('0.6.0', sha256='66b633a3aae2f557f241ee45b2faa41aa179e4a0bdf39c4ae2e679a2970845a1')
... | true | true |
f71177de257d0e69f4e091f7b908830363392ce1 | 1,170 | py | Python | label_loader.py | fd873630/las_for_korean_bigginer | fa2a6fbbcaecb01bc649596699617afe4fd1f48d | [
"Apache-2.0"
] | null | null | null | label_loader.py | fd873630/las_for_korean_bigginer | fa2a6fbbcaecb01bc649596699617afe4fd1f48d | [
"Apache-2.0"
] | null | null | null | label_loader.py | fd873630/las_for_korean_bigginer | fa2a6fbbcaecb01bc649596699617afe4fd1f48d | [
"Apache-2.0"
] | null | null | null | """
Copyright 2019-present NAVER Corp.
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 wr... | 32.5 | 78 | 0.619658 |
def load_label(label_path):
char2index = dict()
index2char = dict()
with open(label_path, 'r') as f:
for no, line in enumerate(f):
if line[0] == '#':
continue
index, char, freq = line.strip().split('\t')
char = char.strip()
... | true | true |
f71178e955fe419d4b14918267313415cc8e3184 | 1,111 | py | Python | tests/template_tests/test_origin.py | KaushikSathvara/django | 3b9fe906bf28d2e748ce4d9a1af5fbcd5df48946 | [
"BSD-3-Clause",
"0BSD"
] | 61,676 | 2015-01-01T00:05:13.000Z | 2022-03-31T20:37:54.000Z | tests/template_tests/test_origin.py | KaushikSathvara/django | 3b9fe906bf28d2e748ce4d9a1af5fbcd5df48946 | [
"BSD-3-Clause",
"0BSD"
] | 8,884 | 2015-01-01T00:12:05.000Z | 2022-03-31T19:53:11.000Z | tests/template_tests/test_origin.py | mustafa0x/django | d7394cfa13a4d1a02356e3a83e10ec100fbb9948 | [
"BSD-3-Clause",
"0BSD"
] | 33,143 | 2015-01-01T02:04:52.000Z | 2022-03-31T19:42:46.000Z | import os
from unittest import TestCase
from django.template import Engine
from .utils import TEMPLATE_DIR
class OriginTestCase(TestCase):
def setUp(self):
self.engine = Engine(dirs=[TEMPLATE_DIR])
def test_origin_compares_equal(self):
a = self.engine.get_template('index.html')
b = ... | 33.666667 | 67 | 0.660666 | import os
from unittest import TestCase
from django.template import Engine
from .utils import TEMPLATE_DIR
class OriginTestCase(TestCase):
def setUp(self):
self.engine = Engine(dirs=[TEMPLATE_DIR])
def test_origin_compares_equal(self):
a = self.engine.get_template('index.html')
b = ... | true | true |
f711796f876d51ba27773e6025a60538502c0b87 | 325 | py | Python | stage_0_Maurya.py | kristahbel/team-greider | 7d44039d2b2c9abf63d0781cf0eb0b07b5b0ae15 | [
"MIT"
] | 9 | 2021-08-01T20:26:55.000Z | 2021-08-07T11:32:25.000Z | stage_0_Maurya.py | kristahbel/team-greider | 7d44039d2b2c9abf63d0781cf0eb0b07b5b0ae15 | [
"MIT"
] | 2 | 2021-08-02T09:08:09.000Z | 2021-08-03T21:10:24.000Z | stage_0_Maurya.py | kristahbel/team-greider | 7d44039d2b2c9abf63d0781cf0eb0b07b5b0ae15 | [
"MIT"
] | 16 | 2021-08-01T19:41:45.000Z | 2021-08-06T09:26:15.000Z | print("NAME: Maurya Sharma \nE-MAIL: mauryasharma2001@gmail.com \nSLACK USERNAME: @Maurya \nBIOSTACK: Drug Development \nTwitter Handle: @Maurya")
def hamming_distance(a,b):
count=0
for i in range(len(a)):
if a[i] != b[i]:
count +=1
return count
print(hamming_distance('@Maurya','@Maurya... | 29.545455 | 146 | 0.655385 | print("NAME: Maurya Sharma \nE-MAIL: mauryasharma2001@gmail.com \nSLACK USERNAME: @Maurya \nBIOSTACK: Drug Development \nTwitter Handle: @Maurya")
def hamming_distance(a,b):
count=0
for i in range(len(a)):
if a[i] != b[i]:
count +=1
return count
print(hamming_distance('@Maurya','@Maurya... | true | true |
f71179d38880b8bc4de2699f0c56637b7ad4d1ca | 7,757 | py | Python | frappe/core/doctype/report/report.py | linkmultiselect/frappe | 0871db97f6aa9738e6aff169ad2b9853980b0653 | [
"MIT"
] | null | null | null | frappe/core/doctype/report/report.py | linkmultiselect/frappe | 0871db97f6aa9738e6aff169ad2b9853980b0653 | [
"MIT"
] | 5 | 2020-03-24T18:15:00.000Z | 2021-03-25T23:28:34.000Z | frappe/core/doctype/report/report.py | linkmultiselect/frappe | 0871db97f6aa9738e6aff169ad2b9853980b0653 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import json, datetime
from frappe import _, scrub
import frappe.desk.query_report
from frappe.utils import cint
from frappe.model.document import Document
from frapp... | 30.904382 | 107 | 0.695114 |
from __future__ import unicode_literals
import frappe
import json, datetime
from frappe import _, scrub
import frappe.desk.query_report
from frappe.utils import cint
from frappe.model.document import Document
from frappe.modules.export_file import export_to_files
from frappe.modules import make_boilerplate
from frap... | true | true |
f7117ab7e8d3065cd1ef2a5ccec476a5acced2e5 | 2,940 | py | Python | third_party/maya/lib/usdMaya/testenv/testUsdMayaBlockSceneModificationContext.py | octarrow/USD | 1845291a9701ab0a3a7d591bc243a1a80fdcba8a | [
"Unlicense"
] | 3 | 2019-02-20T07:34:17.000Z | 2019-08-13T08:17:04.000Z | third_party/maya/lib/usdMaya/testenv/testUsdMayaBlockSceneModificationContext.py | octarrow/USD | 1845291a9701ab0a3a7d591bc243a1a80fdcba8a | [
"Unlicense"
] | null | null | null | third_party/maya/lib/usdMaya/testenv/testUsdMayaBlockSceneModificationContext.py | octarrow/USD | 1845291a9701ab0a3a7d591bc243a1a80fdcba8a | [
"Unlicense"
] | null | null | null | #!/pxrpythonsubst
#
# Copyright 2018 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 31.956522 | 78 | 0.709864 |
import unittest
try:
from pxr import UsdMaya
except ImportError:
from pixar import UsdMaya
from maya import cmds
from maya import standalone
class testUsdMayaBlockSceneModificationContext(unittest.TestCase):
@classmethod
def setUpClass(cls):
standalone.initialize('u... | true | true |
f7117b559401200e7a843fee1491e12e035b59b3 | 5,643 | py | Python | tests/python/relay/test_op_qnn_subtract.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | tests/python/relay/test_op_qnn_subtract.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 3,022 | 2020-11-24T14:02:31.000Z | 2022-03-31T23:55:31.000Z | tests/python/relay/test_op_qnn_subtract.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.619632 | 97 | 0.605352 |
import tvm
import numpy as np
from tvm import relay
def qnn_subtract_driver(x_datas, y_datas, golden_outputs, scale_and_zp, data_dtype="uint8"):
assert len(x_datas) == len(y_datas)
assert len(y_datas) == len(golden_outputs)
x = relay.var("x", shape=(1, 4), dtype=data_dtype)
y = ... | true | true |
f7117b7fbebe9c690c58224ea3729a3b15dcc160 | 2,501 | py | Python | generate_thumbnails.py | AdamHawtin/bucket-thumbnail-generator | db42e0dca709156513b47f17cd540fb68c1dfe0e | [
"MIT"
] | null | null | null | generate_thumbnails.py | AdamHawtin/bucket-thumbnail-generator | db42e0dca709156513b47f17cd540fb68c1dfe0e | [
"MIT"
] | 6 | 2021-04-30T20:51:43.000Z | 2022-03-11T23:54:26.000Z | generate_thumbnails.py | AdamHawtin/bucket-thumbnail-generator | db42e0dca709156513b47f17cd540fb68c1dfe0e | [
"MIT"
] | null | null | null | import os
import tempfile
from pathlib import Path
from PIL import Image
from google.cloud import storage
from retrying import retry
THUMBNAIL_SIZE = int(os.getenv('THUMBNAIL_SIZE', '128'))
THUMBNAIL_MAX_DIM = THUMBNAIL_SIZE, THUMBNAIL_SIZE
THUMBNAIL_SUFFIX = f'_thumb{THUMBNAIL_SIZE}'
SUPPORTED_FILE_EXTENSIONS = {'jp... | 38.476923 | 110 | 0.745702 | import os
import tempfile
from pathlib import Path
from PIL import Image
from google.cloud import storage
from retrying import retry
THUMBNAIL_SIZE = int(os.getenv('THUMBNAIL_SIZE', '128'))
THUMBNAIL_MAX_DIM = THUMBNAIL_SIZE, THUMBNAIL_SIZE
THUMBNAIL_SUFFIX = f'_thumb{THUMBNAIL_SIZE}'
SUPPORTED_FILE_EXTENSIONS = {'jp... | true | true |
f7117ca57b1ebd5861c109a4273cbe7837519188 | 22,933 | py | Python | libcxx/utils/libcxx/test/config.py | val-verde/llvm-project | a5d4e884dad341ff80fbbdec6e7516b9c58c9eb0 | [
"Apache-2.0"
] | null | null | null | libcxx/utils/libcxx/test/config.py | val-verde/llvm-project | a5d4e884dad341ff80fbbdec6e7516b9c58c9eb0 | [
"Apache-2.0"
] | null | null | null | libcxx/utils/libcxx/test/config.py | val-verde/llvm-project | a5d4e884dad341ff80fbbdec6e7516b9c58c9eb0 | [
"Apache-2.0"
] | null | null | null | #===----------------------------------------------------------------------===##
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------------------------------... | 46.706721 | 106 | 0.608032 |
mport copy
import os
import pkgutil
import pipes
import platform
import re
import shlex
import shutil
import sys
from libcxx.compiler import CXXCompiler
from libcxx.test.target_info import make_target_info
import libcxx.util
import libcxx.test.features
import libcxx.test.newconfig
import libcxx.test.params
import l... | true | true |
f7117d2b4d5ff936d18079dc6cda0605b3a809a0 | 2,778 | py | Python | aodh/event.py | ISCAS-VDI/aodh-base | 4e7a8aef80054c49e8e8b32715cecd32b425d617 | [
"Apache-2.0"
] | null | null | null | aodh/event.py | ISCAS-VDI/aodh-base | 4e7a8aef80054c49e8e8b32715cecd32b425d617 | [
"Apache-2.0"
] | null | null | null | aodh/event.py | ISCAS-VDI/aodh-base | 4e7a8aef80054c49e8e8b32715cecd32b425d617 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2015 NEC 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 w... | 34.725 | 76 | 0.677826 |
from oslo_config import cfg
from oslo_log import log
import oslo_messaging
from oslo_service import service
from aodh.evaluator import event
from aodh import messaging
from aodh import storage
LOG = log.getLogger(__name__)
OPTS = [
cfg.StrOpt('event_alarm_topic',
default='alarm.all'... | true | true |
f7117d745cb7ceac2a3526e0c33d5632064d579a | 14,533 | py | Python | seekr2/tests/test_analyze.py | astokely/seekr2 | 2fd8496dc885339437678a729b1f97a4b0bf9cfd | [
"MIT"
] | null | null | null | seekr2/tests/test_analyze.py | astokely/seekr2 | 2fd8496dc885339437678a729b1f97a4b0bf9cfd | [
"MIT"
] | null | null | null | seekr2/tests/test_analyze.py | astokely/seekr2 | 2fd8496dc885339437678a729b1f97a4b0bf9cfd | [
"MIT"
] | null | null | null | """
test_analyze.py
Testing analyze.py
"""
import os
from collections import defaultdict
import numpy as np
import seekr2.modules.common_analyze as common_analyze
import seekr2.modules.mmvt_analyze as mmvt_analyze
import seekr2.analyze as analyze
import seekr2.modules.common_base as base
import seekr2.modules.mmvt_... | 38.651596 | 106 | 0.616321 |
import os
from collections import defaultdict
import numpy as np
import seekr2.modules.common_analyze as common_analyze
import seekr2.modules.mmvt_analyze as mmvt_analyze
import seekr2.analyze as analyze
import seekr2.modules.common_base as base
import seekr2.modules.mmvt_base as mmvt_base
import seekr2.tests.smoluc... | true | true |
f7117e9d65d3037430dcb359a8dce4e7f2d80980 | 2,577 | py | Python | oamap/backend/numpyfile.py | Jayd-1234/oamap | b10ddab18ca2bf71171c5489c1b748a60ec962fb | [
"BSD-3-Clause"
] | null | null | null | oamap/backend/numpyfile.py | Jayd-1234/oamap | b10ddab18ca2bf71171c5489c1b748a60ec962fb | [
"BSD-3-Clause"
] | null | null | null | oamap/backend/numpyfile.py | Jayd-1234/oamap | b10ddab18ca2bf71171c5489c1b748a60ec962fb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2017, DIANA-HEP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list ... | 42.95 | 130 | 0.756306 |
import os
import numpy
import oamap.dataset
import oamap.database
class NumpyFileBackend(oamap.database.FilesystemBackend):
def __init__(self, directory):
super(NumpyFileBackend, self).__init__(directory, arraysuffix=".npy")
def instantiate(self, partitionid):
r... | true | true |
f7117f6c404b1da6555aeeae0b08a7f9be81f25d | 89,437 | py | Python | intersight/model/softwarerepository_file_server.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/softwarerepository_file_server.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/softwarerepository_file_server.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... | 65.377924 | 1,678 | 0.677617 |
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 |
f71180058b96632b2f3dd3308a51630c15ace975 | 1,638 | bzl | Python | test/haxe_executable_dependency.bzl | kigero/rules_haxe | 1cee9a6ccf4c26656c5b7d1fb2d56f2fa9c01fa1 | [
"MIT"
] | null | null | null | test/haxe_executable_dependency.bzl | kigero/rules_haxe | 1cee9a6ccf4c26656c5b7d1fb2d56f2fa9c01fa1 | [
"MIT"
] | null | null | null | test/haxe_executable_dependency.bzl | kigero/rules_haxe | 1cee9a6ccf4c26656c5b7d1fb2d56f2fa9c01fa1 | [
"MIT"
] | null | null | null | """
Test that the build parameters for external modules with dependencies are computed correctly.
"""
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
load("//:providers.bzl", "HaxeLibraryInfo")
load("//:utils.bzl", "determine_source_root")
def _haxe_executable_dependency_test_impl(ctx):
... | 46.8 | 158 | 0.738706 |
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
load("//:providers.bzl", "HaxeLibraryInfo")
load("//:utils.bzl", "determine_source_root")
def _haxe_executable_dependency_test_impl(ctx):
env = analysistest.begin(ctx)
target_under_test = analysistest.target_under_test(env)
hxm... | true | true |
f711809cde8a0a5d600e12a758e6baa43a035a9b | 3,957 | py | Python | whalesong/managers/group_metadata.py | gladimaz/whalesong | dab496498d188b3f7b4d5d67ef1c0e2a46cce535 | [
"MIT"
] | 57 | 2018-06-20T12:37:58.000Z | 2021-08-14T14:32:26.000Z | whalesong/managers/group_metadata.py | gladimaz/whalesong | dab496498d188b3f7b4d5d67ef1c0e2a46cce535 | [
"MIT"
] | 91 | 2018-06-21T02:04:29.000Z | 2020-04-12T20:16:04.000Z | whalesong/managers/group_metadata.py | gladimaz/whalesong | dab496498d188b3f7b4d5d67ef1c0e2a46cce535 | [
"MIT"
] | 24 | 2018-07-02T08:31:52.000Z | 2020-05-19T01:36:18.000Z | from typing import List
from dirty_models import ArrayField, BooleanField, ModelField, StringField, StringIdField
from . import BaseCollectionManager, BaseModelManager
from ..models import BaseModel, DateTimeField
from ..results import Result
class Participant(BaseModel):
is_admin = BooleanField(default=False)
... | 26.736486 | 92 | 0.686631 | from typing import List
from dirty_models import ArrayField, BooleanField, ModelField, StringField, StringIdField
from . import BaseCollectionManager, BaseModelManager
from ..models import BaseModel, DateTimeField
from ..results import Result
class Participant(BaseModel):
is_admin = BooleanField(default=False)
... | true | true |
f71181212ea961615fd991f19319e4e5222e52f0 | 5,905 | py | Python | skan/pipe.py | marlene09/skan | 4e84ff8ac83e912c9cf4a44b8274c3a5699027ad | [
"BSD-3-Clause"
] | 1 | 2021-02-08T04:45:38.000Z | 2021-02-08T04:45:38.000Z | skan/pipe.py | mkcor/skan | 97a217d36ec1393b380d4a797b5b7ceb68e824ec | [
"BSD-3-Clause"
] | null | null | null | skan/pipe.py | mkcor/skan | 97a217d36ec1393b380d4a797b5b7ceb68e824ec | [
"BSD-3-Clause"
] | null | null | null | import os
from . import pre, csr
import imageio
from tqdm import tqdm
import numpy as np
from skimage import morphology
import pandas as pd
from .image_stats import image_summary
from skimage.feature import shape_index
from concurrent.futures import ThreadPoolExecutor, as_completed
import multiprocessing as mp
CPU_CO... | 41.584507 | 79 | 0.631499 | import os
from . import pre, csr
import imageio
from tqdm import tqdm
import numpy as np
from skimage import morphology
import pandas as pd
from .image_stats import image_summary
from skimage.feature import shape_index
from concurrent.futures import ThreadPoolExecutor, as_completed
import multiprocessing as mp
CPU_CO... | true | true |
f71183a31b57d8e8d37c461a4adb535c2b4581ed | 931 | py | Python | backend/public_info/migrations/0001_initial.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | backend/public_info/migrations/0001_initial.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | backend/public_info/migrations/0001_initial.py | StichtingIAPC/swipe | d1ea35a40813d2d5e9cf9edde33148c0a825efc4 | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-05-29 18:22
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove... | 31.033333 | 128 | 0.627282 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
migrations.Crea... | true | true |
f71183b5bb67d22693deef525c7d46aca9642f09 | 41,533 | py | Python | src/uvm/base/uvm_object.py | mgielda/uvm-python | 7750bc163130f59741e464bb5fcf8fb5324dbf56 | [
"Apache-2.0"
] | null | null | null | src/uvm/base/uvm_object.py | mgielda/uvm-python | 7750bc163130f59741e464bb5fcf8fb5324dbf56 | [
"Apache-2.0"
] | null | null | null | src/uvm/base/uvm_object.py | mgielda/uvm-python | 7750bc163130f59741e464bb5fcf8fb5324dbf56 | [
"Apache-2.0"
] | null | null | null | #
#-----------------------------------------------------------------------------
# Copyright 2007-2011 Mentor Graphics Corporation
# Copyright 2007-2011 Cadence Design Systems, Inc.
# Copyright 2010 Synopsys, Inc.
# Copyright 2013 NVIDIA Corporation
# Copyright 2019-2020 Tuomas Poikela (tpoikela)
# All Righ... | 38.815888 | 109 | 0.618905 |
from typing import Dict, Any
from .sv import sv, sv_obj
from .uvm_misc import UVMStatusContainer
from .uvm_object_globals import (UVM_PRINT, UVM_NONE, UVM_COPY, UVM_COMPARE,
UVM_RECORD, UVM_SETINT, UVM_SETOBJ, UVM_SETSTR, UVM_PACK, UVM_UNPACK)
from .uvm_globals import uvm_report_error, ... | true | true |
f71184809c1d37c6cf6003cf5cf482e0e2c00413 | 851 | py | Python | api/source/actions/report.py | 1pkg/ReRe | 83f77d2cece0fb5f6d7b86a395fcca7d4e16459f | [
"MIT"
] | 1 | 2019-12-17T10:31:48.000Z | 2019-12-17T10:31:48.000Z | api/source/actions/report.py | c-pkg/ReRe | 83f77d2cece0fb5f6d7b86a395fcca7d4e16459f | [
"MIT"
] | null | null | null | api/source/actions/report.py | c-pkg/ReRe | 83f77d2cece0fb5f6d7b86a395fcca7d4e16459f | [
"MIT"
] | 1 | 2019-04-29T08:19:36.000Z | 2019-04-29T08:19:36.000Z | from errors import Request
from .mixins import Identify
class Report(Identify):
def _validate(self, request):
super()._validate(request)
validator = self._application.validator
self.__message = self._get(request, 'message', '').strip()
if validator.isempty(self.__message):
... | 29.344828 | 66 | 0.599295 | from errors import Request
from .mixins import Identify
class Report(Identify):
def _validate(self, request):
super()._validate(request)
validator = self._application.validator
self.__message = self._get(request, 'message', '').strip()
if validator.isempty(self.__message):
... | true | true |
f71184decb3ccbf135e84e58d21e4b1a23058855 | 2,750 | py | Python | Canvas Announcement to Telegram bot/main.py | VoluSign/CanvasToTelegramBot | ce009616b0e59928705d216bb60ba38960a8121a | [
"MIT"
] | null | null | null | Canvas Announcement to Telegram bot/main.py | VoluSign/CanvasToTelegramBot | ce009616b0e59928705d216bb60ba38960a8121a | [
"MIT"
] | null | null | null | Canvas Announcement to Telegram bot/main.py | VoluSign/CanvasToTelegramBot | ce009616b0e59928705d216bb60ba38960a8121a | [
"MIT"
] | null | null | null | #install canvasapi, pyTelegramBotAPI
# Imports
import sys, os
import canvasapi
import telebot
from html.parser import HTMLParser
from canvasapi import Canvas, discussion_topic
#----# CANVAS #----#
#Class handles html to ascii conversion
class HTMLFilter(HTMLParser):
text = ""
def handle_data(se... | 26.442308 | 215 | 0.697091 |
import sys, os
import canvasapi
import telebot
from html.parser import HTMLParser
from canvasapi import Canvas, discussion_topic
Parser):
text = ""
def handle_data(self, postContent):
self.text += postContent
new = False
API_URL = "!CANVAS BASE URL!"
API_KEY = "!CANVAS USER API K... | true | true |
f71185711cb0e985705a4aeadd7aec248ed1e378 | 1,208 | py | Python | tests/integration/bulkexports/v1/test_export.py | ashish-s/twilio-python | 5462b05af0906a1464b1e95a56a1f15afddc3b8c | [
"MIT"
] | 1 | 2020-10-29T19:28:25.000Z | 2020-10-29T19:28:25.000Z | tests/integration/bulkexports/v1/test_export.py | CostantiniMatteo/twilio-python | 9eee1ca9e73790b12678e9a5660206ea44948d00 | [
"MIT"
] | 1 | 2020-08-25T15:27:57.000Z | 2020-08-25T15:27:57.000Z | tests/integration/bulkexports/v1/test_export.py | team-telnyx/twexit-python | 69e11c5c2b5681f9bc410795dda0cf8942219e6f | [
"MIT"
] | null | null | null | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class ExportTestCase(Integratio... | 26.844444 | 82 | 0.575331 |
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class ExportTestCase(IntegrationTestCase):
def test_fetch_request(self):
self.holodeck.mock(Response(500, ''))
with self.assertR... | true | true |
f7118586b9feaedeb8d333db83568c6708557252 | 2,356 | py | Python | oidc_server/app/models.py | didx-xyz/aries-accpy-oidc | 63a91a58861383c38a43bca0aab0e0e837596a98 | [
"Apache-2.0"
] | null | null | null | oidc_server/app/models.py | didx-xyz/aries-accpy-oidc | 63a91a58861383c38a43bca0aab0e0e837596a98 | [
"Apache-2.0"
] | null | null | null | oidc_server/app/models.py | didx-xyz/aries-accpy-oidc | 63a91a58861383c38a43bca0aab0e0e837596a98 | [
"Apache-2.0"
] | null | null | null | '''OIDC server example'''
# import datetime
from sqlalchemy import Column, Integer, String
from sqlalchemy.dialects.sqlite import JSON
# from authlib.integrations.sqla_oauth2 import (
# OAuth2ClientMixin,
# OAuth2TokenMixin,
# OAuth2AuthorizationCodeMixin
# )
from database import Base
from utils import disa... | 32.722222 | 111 | 0.667233 |
from sqlalchemy import Column, Integer, String
from sqlalchemy.dialects.sqlite import JSON
from database import Base
from utils import disambiguate_referent
import uuid
class User(Base):
__tablename__ = "user"
id = Column(Integer, primary_key=True)
uuid = Column(String(100), unique=True)
... | true | true |
f7118591d151dce6e3fd6f3d413d3c52d74ea81f | 440 | py | Python | examples/send.py | apistd/uni-python-sdk | e0607cfce86bea696896864a55f157d69ec532a2 | [
"MIT"
] | null | null | null | examples/send.py | apistd/uni-python-sdk | e0607cfce86bea696896864a55f157d69ec532a2 | [
"MIT"
] | null | null | null | examples/send.py | apistd/uni-python-sdk | e0607cfce86bea696896864a55f157d69ec532a2 | [
"MIT"
] | null | null | null | from unisdk.sms import UniSMS
from unisdk.exception import UniException
def example():
client = UniSMS("your access key id", "your access key secret")
try:
res = client.send({
"to": "your phone number",
"signature": "UniSMS",
"templateId": "login_tmpl",
"templateData": {
"code"... | 20 | 65 | 0.604545 | from unisdk.sms import UniSMS
from unisdk.exception import UniException
def example():
client = UniSMS("your access key id", "your access key secret")
try:
res = client.send({
"to": "your phone number",
"signature": "UniSMS",
"templateId": "login_tmpl",
"templateData": {
"code"... | true | true |
f7118593cd8a341fc9d5b082a83299a32ae61b18 | 1,666 | py | Python | setup.py | rafiibrahim8/truewho | 59323414ec196964bcb69364b942b0e11a26b592 | [
"MIT"
] | 1 | 2021-05-24T15:37:36.000Z | 2021-05-24T15:37:36.000Z | setup.py | rafiibrahim8/truewho | 59323414ec196964bcb69364b942b0e11a26b592 | [
"MIT"
] | 2 | 2021-08-17T16:22:24.000Z | 2022-02-08T20:40:55.000Z | setup.py | rafiibrahim8/truewho | 59323414ec196964bcb69364b942b0e11a26b592 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from truewho import __version__
def read_file(filename, lines=False):
try:
with open(filename, "r") as f:
if lines:
return [i.strip() for i in f.readlines() if (i.strip())]
return f.read()
except:
print("Can no... | 33.32 | 85 | 0.62485 | from setuptools import setup, find_packages
from truewho import __version__
def read_file(filename, lines=False):
try:
with open(filename, "r") as f:
if lines:
return [i.strip() for i in f.readlines() if (i.strip())]
return f.read()
except:
print("Can no... | true | true |
f71185ef3a091033b981050e0faaa74cbc6fd8c3 | 1,244 | py | Python | airflow/contrib/operators/bigquery_to_bigquery.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | null | null | null | airflow/contrib/operators/bigquery_to_bigquery.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | 1 | 2019-05-14T14:32:40.000Z | 2019-05-14T14:32:40.000Z | airflow/contrib/operators/bigquery_to_bigquery.py | dorranh/airflow | 1a9a2cadcf8606cfcb729d1323dd33dfacc64633 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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
#... | 41.466667 | 109 | 0.777331 |
import warnings
from airflow.providers.google.cloud.operators.bigquery_to_bigquery import BigQueryToBigQueryOperator
warnings.warn(
"This module is deprecated. Please use `airflow.providers.google.cloud.operators.bigquery_to_bigquery`.",
DeprecationWarning, stacklevel=2
)
| true | true |
f71186d761ae034d147180c445dbdb503ea95a8a | 270 | py | Python | messaging_abstract/protocol/protocol.py | fgiorgetti/qpid-dispatch-tests | 164c609d28db87692eed53d5361aa1ee5c97375c | [
"Apache-2.0"
] | null | null | null | messaging_abstract/protocol/protocol.py | fgiorgetti/qpid-dispatch-tests | 164c609d28db87692eed53d5361aa1ee5c97375c | [
"Apache-2.0"
] | 9 | 2018-09-25T10:10:58.000Z | 2019-03-19T14:59:43.000Z | messaging_abstract/protocol/protocol.py | fgiorgetti/qpid-dispatch-tests | 164c609d28db87692eed53d5361aa1ee5c97375c | [
"Apache-2.0"
] | 1 | 2019-03-13T10:40:35.000Z | 2019-03-13T10:40:35.000Z | class Protocol:
""" Protocol abstraction"""
def __init__(self, transaction, transport, default_port=None):
self.name = type(self).__name__
self.default_port = default_port
self.transaction = transaction
self.transport = transport
| 33.75 | 66 | 0.677778 | class Protocol:
def __init__(self, transaction, transport, default_port=None):
self.name = type(self).__name__
self.default_port = default_port
self.transaction = transaction
self.transport = transport
| true | true |
f71186fae75d95345162e3986a1e82e564e2b9b9 | 55,150 | py | Python | openprocurement/tender/openuadefense/tests/bid.py | Leits/openprocurement.tender.openuadefense | e7c512ed21166ae1928950bce80a11106fa2e545 | [
"Apache-2.0"
] | null | null | null | openprocurement/tender/openuadefense/tests/bid.py | Leits/openprocurement.tender.openuadefense | e7c512ed21166ae1928950bce80a11106fa2e545 | [
"Apache-2.0"
] | 2 | 2021-03-26T00:34:56.000Z | 2022-03-21T22:20:41.000Z | openprocurement/tender/openuadefense/tests/bid.py | leits/openprocurement.tender.openuadefense | e7c512ed21166ae1928950bce80a11106fa2e545 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from copy import deepcopy
from openprocurement.api.tests.base import test_organization
from openprocurement.tender.openua.tests.base import test_bids
from openprocurement.tender.openuadefense.tests.base import (
BaseTenderUAContentWebTest,
test_tender_data,
test_feat... | 54.38856 | 300 | 0.621958 |
import unittest
from copy import deepcopy
from openprocurement.api.tests.base import test_organization
from openprocurement.tender.openua.tests.base import test_bids
from openprocurement.tender.openuadefense.tests.base import (
BaseTenderUAContentWebTest,
test_tender_data,
test_features_tender_ua_data)
... | true | true |
f711872787c8b74e9d0ed508cf7608719b9ca9e6 | 578 | py | Python | simsoexp/migrations/0007_schedulingpolicy_contributor.py | Scriptopathe/simso-exp | d618463272f42a1ca3345ff162b7a9f1a6fab3f8 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | simsoexp/migrations/0007_schedulingpolicy_contributor.py | Scriptopathe/simso-exp | d618463272f42a1ca3345ff162b7a9f1a6fab3f8 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2015-07-31T15:00:21.000Z | 2015-07-31T15:09:37.000Z | simsoexp/migrations/0007_schedulingpolicy_contributor.py | Scriptopathe/simso-exp | d618463272f42a1ca3345ff162b7a9f1a6fab3f8 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('simsoexp', '0006_auto_20150721_1432'),
... | 25.130435 | 76 | 0.65917 |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('simsoexp', '0006_auto_20150721_1432'),
]
operations = [... | true | true |
f71187924dd29115494236387e90989c2fbe1e27 | 15,473 | py | Python | tests/integration/test_install_basic.py | jrottenberg/pipenv | cda15b3b30e04e038ee286bced6c47a311f1e0ec | [
"MIT"
] | 6,263 | 2017-01-20T17:41:36.000Z | 2022-02-15T20:48:57.000Z | tests/integration/test_install_basic.py | jrottenberg/pipenv | cda15b3b30e04e038ee286bced6c47a311f1e0ec | [
"MIT"
] | 1,100 | 2017-01-20T19:41:52.000Z | 2017-12-06T09:15:13.000Z | tests/integration/test_install_basic.py | jrottenberg/pipenv | cda15b3b30e04e038ee286bced6c47a311f1e0ec | [
"MIT"
] | 366 | 2017-01-21T10:06:52.000Z | 2021-11-25T17:09:19.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import os
import pytest
from flaky import flaky
from pipenv._compat import Path, TemporaryDirectory
from pipenv.utils import temp_environ
from pipenv.vendor import delegator
@pytest.mark.setup
@pytest.mark.basic
@pytest.mark.install
def... | 31.195565 | 95 | 0.625541 |
from __future__ import absolute_import, print_function
import os
import pytest
from flaky import flaky
from pipenv._compat import Path, TemporaryDirectory
from pipenv.utils import temp_environ
from pipenv.vendor import delegator
@pytest.mark.setup
@pytest.mark.basic
@pytest.mark.install
def test_basic_setup(Pipen... | true | true |
f71187b2306a598f985c5bc1f8ab04fb06221b75 | 4,764 | py | Python | docs/conf.py | aadu/cake | 4831ebea425a7c0414020702415b793e489e024e | [
"MIT"
] | null | null | null | docs/conf.py | aadu/cake | 4831ebea425a7c0414020702415b793e489e024e | [
"MIT"
] | 5 | 2020-03-24T16:25:11.000Z | 2021-06-01T22:51:29.000Z | docs/conf.py | aadu/cake | 4831ebea425a7c0414020702415b793e489e024e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# cake documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... | 29.04878 | 77 | 0.680101 |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import cake
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'cake'
copyright = u"2018, Aaron Duke"
author = u"Aaron Du... | true | true |
f7118823a87b93a43872741884cd7efddc1ccb73 | 13,516 | py | Python | test/functional/rpc_scantxoutset.py | BitPalnet/BitPal | 0cce7aea31a2e45fecec0e2ef42728aa26355704 | [
"MIT"
] | 1 | 2021-03-09T22:25:20.000Z | 2021-03-09T22:25:20.000Z | test/functional/rpc_scantxoutset.py | BitPalnet/BitPal | 0cce7aea31a2e45fecec0e2ef42728aa26355704 | [
"MIT"
] | null | null | null | test/functional/rpc_scantxoutset.py | BitPalnet/BitPal | 0cce7aea31a2e45fecec0e2ef42728aa26355704 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The BitPal Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the scantxoutset rpc call."""
from test_framework.test_framework import BitPalTestFramework
from te... | 105.59375 | 531 | 0.73831 |
from test_framework.test_framework import BitPalTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error
from decimal import Decimal
import shutil
import os
def descriptors(out):
return sorted(u['desc'] for u in out['unspents'])
class ScantxoutsetTest(BitPalTestFramework):
def ... | true | true |
f711891408202ec5e37aa87f924bca39e8995574 | 5,611 | py | Python | reproject/utils.py | astropy/reproject | 43b0d8a4a5641cfbe6adbc3b1f2d7598f2fd5930 | [
"BSD-3-Clause"
] | 39 | 2019-05-11T19:23:33.000Z | 2022-02-28T12:25:37.000Z | reproject/utils.py | astropy/reproject | 43b0d8a4a5641cfbe6adbc3b1f2d7598f2fd5930 | [
"BSD-3-Clause"
] | 121 | 2018-12-06T16:36:05.000Z | 2022-03-31T23:52:40.000Z | reproject/utils.py | astropy/reproject | 43b0d8a4a5641cfbe6adbc3b1f2d7598f2fd5930 | [
"BSD-3-Clause"
] | 17 | 2018-12-05T04:14:48.000Z | 2021-12-09T22:29:54.000Z | import numpy as np
import astropy.nddata
from astropy.io import fits
from astropy.io.fits import CompImageHDU, HDUList, Header, ImageHDU, PrimaryHDU
from astropy.wcs import WCS
from astropy.wcs.wcsapi import BaseHighLevelWCS
__all__ = ['parse_input_data', 'parse_input_shape', 'parse_input_weights',
'parse_... | 41.257353 | 88 | 0.640171 | import numpy as np
import astropy.nddata
from astropy.io import fits
from astropy.io.fits import CompImageHDU, HDUList, Header, ImageHDU, PrimaryHDU
from astropy.wcs import WCS
from astropy.wcs.wcsapi import BaseHighLevelWCS
__all__ = ['parse_input_data', 'parse_input_shape', 'parse_input_weights',
'parse_... | true | true |
f71189ffbe9ac0e6918cf13b221be71313d98d51 | 574 | py | Python | tests/dumb_plugins/valid/__init__.py | dechainers/dechainy | f742cd77e93c6c5adfecf7509cf35e386ea25c6d | [
"Apache-2.0"
] | 1 | 2022-02-01T11:34:13.000Z | 2022-02-01T11:34:13.000Z | tests/dumb_plugins/valid/__init__.py | dechainers/dechainy | f742cd77e93c6c5adfecf7509cf35e386ea25c6d | [
"Apache-2.0"
] | null | null | null | tests/dumb_plugins/valid/__init__.py | dechainers/dechainy | f742cd77e93c6c5adfecf7509cf35e386ea25c6d | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from dechainy.plugins import Probe
from dechainy.ebpf import EbpfCompiler
@dataclass
class Valid(Probe):
def __post_init__(self):
self.ingress.required = True
self.ingress.cflags.append("-DCUSTOM_VARIABLE=0")
self.egress.required = False
super().... | 28.7 | 73 | 0.672474 | from dataclasses import dataclass
from dechainy.plugins import Probe
from dechainy.ebpf import EbpfCompiler
@dataclass
class Valid(Probe):
def __post_init__(self):
self.ingress.required = True
self.ingress.cflags.append("-DCUSTOM_VARIABLE=0")
self.egress.required = False
super().... | true | true |
f7118a0f9174dce416dc80c1510559d262408d78 | 1,959 | py | Python | powerline_shell/themes/default.py | aradzu10/powerline-shell | 299493eb3ad65b0331d9369a279833e61237d9a6 | [
"MIT"
] | null | null | null | powerline_shell/themes/default.py | aradzu10/powerline-shell | 299493eb3ad65b0331d9369a279833e61237d9a6 | [
"MIT"
] | null | null | null | powerline_shell/themes/default.py | aradzu10/powerline-shell | 299493eb3ad65b0331d9369a279833e61237d9a6 | [
"MIT"
] | null | null | null | class DefaultColor(object):
"""
This class should have the default colors for every segment.
Please test every new segment with this theme first.
"""
# RESET is not a real color code. It is used as in indicator
# within the code that any foreground / background color should
# be cleared
... | 22.011236 | 75 | 0.650332 | class DefaultColor(object):
RESET = -1
USERNAME_FG = 250
USERNAME_BG = 240
USERNAME_ROOT_FG = 250
USERNAME_ROOT_BG = 124
HOSTNAME_FG = 250
HOSTNAME_BG = 238
HOME_SPECIAL_DISPLAY = True
HOME_BG = 31
HOME_FG = 15
PATH_BG = 237
PATH_FG = 250
CWD... | true | true |
f7118a9b813f246228dc9f4c53befcf78bec63af | 327 | py | Python | quiz/permissions.py | raksa/django-quickstart | ff3ca34662b0adca4ffb29cfa8f871d861053bf3 | [
"MIT"
] | null | null | null | quiz/permissions.py | raksa/django-quickstart | ff3ca34662b0adca4ffb29cfa8f871d861053bf3 | [
"MIT"
] | 9 | 2019-12-04T23:11:06.000Z | 2022-02-10T11:54:05.000Z | quiz/permissions.py | raksa/django-quickstart | ff3ca34662b0adca4ffb29cfa8f871d861053bf3 | [
"MIT"
] | null | null | null | from rest_framework.permissions import BasePermission
class SuperAdmin(BasePermission):
def has_object_permission(self, request, view, obj):
user = request.user
if not (user and user.is_authenticated):
return False
if user.is_superuser:
return True
return... | 21.8 | 56 | 0.663609 | from rest_framework.permissions import BasePermission
class SuperAdmin(BasePermission):
def has_object_permission(self, request, view, obj):
user = request.user
if not (user and user.is_authenticated):
return False
if user.is_superuser:
return True
return... | true | true |
f7118ac45d271ba608e997e84615b7db483463ed | 1,749 | py | Python | venv/lib/python3.6/site-packages/chatterbot/input/mailgun.py | HackBots1111/flask-server-bot | 683932802d689d21b0b8397acd3f072197dea208 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/chatterbot/input/mailgun.py | HackBots1111/flask-server-bot | 683932802d689d21b0b8397acd3f072197dea208 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/chatterbot/input/mailgun.py | HackBots1111/flask-server-bot | 683932802d689d21b0b8397acd3f072197dea208 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import datetime
from chatterbot.input import InputAdapter
from chatterbot.conversation import Statement
class Mailgun(InputAdapter):
"""
Get input from Mailgun.
"""
def __init__(self, **kwargs):
super(Mailgun, self).__init__(**kwargs)
... | 28.209677 | 68 | 0.56032 | from __future__ import unicode_literals
import datetime
from chatterbot.input import InputAdapter
from chatterbot.conversation import Statement
class Mailgun(InputAdapter):
def __init__(self, **kwargs):
super(Mailgun, self).__init__(**kwargs)
self.name = kwargs.get('name')
... | true | true |
f7118b05dced8094fd2666a79e6f6a3ed7eb88be | 1,363 | py | Python | linear_regression.py | kohjingyu/prob-stats | df396686b641079b5db93118b1b2373d79de7d7a | [
"MIT"
] | 3 | 2018-03-16T15:31:57.000Z | 2018-06-13T06:36:57.000Z | linear_regression.py | kohjingyu/prob-stats | df396686b641079b5db93118b1b2373d79de7d7a | [
"MIT"
] | null | null | null | linear_regression.py | kohjingyu/prob-stats | df396686b641079b5db93118b1b2373d79de7d7a | [
"MIT"
] | null | null | null | import matplotlib
import matplotlib.pyplot as plt
x = [20, 23, 29, 27, 30, 34, 35, 37, 40, 43]
y = [1.32, 1.67, 2.17, 2.70, 2.75, 2.87, 3.65, 2.86, 3.61, 4.25]
n = len(x)
assert(n == len(y))
# Means
bar_x = sum(x) / n
bar_y = sum(y) / n
# Sum of squares
sxy = sum([(x[i] - bar_x) * (y[i] - bar_y) for i in range(n)])
... | 27.816327 | 74 | 0.581071 | import matplotlib
import matplotlib.pyplot as plt
x = [20, 23, 29, 27, 30, 34, 35, 37, 40, 43]
y = [1.32, 1.67, 2.17, 2.70, 2.75, 2.87, 3.65, 2.86, 3.61, 4.25]
n = len(x)
assert(n == len(y))
bar_x = sum(x) / n
bar_y = sum(y) / n
sxy = sum([(x[i] - bar_x) * (y[i] - bar_y) for i in range(n)])
sxx = sum([(x[i] - bar_... | true | true |
f7118bb7f85eb63551ff192af78a4fa82b04fb29 | 10,895 | py | Python | sensor.py | sasgoose/sureha | 47558ba2a000a7b65fa8b2e9fc91d5ce3e0c8291 | [
"Apache-2.0"
] | null | null | null | sensor.py | sasgoose/sureha | 47558ba2a000a7b65fa8b2e9fc91d5ce3e0c8291 | [
"Apache-2.0"
] | null | null | null | sensor.py | sasgoose/sureha | 47558ba2a000a7b65fa8b2e9fc91d5ce3e0c8291 | [
"Apache-2.0"
] | null | null | null | """Support for Sure PetCare Flaps/Pets sensors."""
from __future__ import annotations
from typing import Any, cast
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_VOLTAGE,
DEVICE_CLASS_BATTERY,
MASS_GRAMS,... | 31.397695 | 88 | 0.608261 | from __future__ import annotations
from typing import Any, cast
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_VOLTAGE,
DEVICE_CLASS_BATTERY,
MASS_GRAMS,
PERCENTAGE,
VOLUME_MILLILITERS,
)
from hom... | true | true |
f7118c03a435f2a29e604414e5c30c3bbf8bfdb0 | 22,879 | py | Python | toc_trends_analysis.py | JamesSample/icpw | 47562f601fc8fe23720267d083dabc540889565e | [
"MIT"
] | 1 | 2020-05-06T21:18:33.000Z | 2020-05-06T21:18:33.000Z | toc_trends_analysis.py | JamesSample/icpw | 47562f601fc8fe23720267d083dabc540889565e | [
"MIT"
] | 1 | 2020-02-05T16:50:23.000Z | 2020-03-26T16:16:37.000Z | toc_trends_analysis.py | JamesSample/icpw | 47562f601fc8fe23720267d083dabc540889565e | [
"MIT"
] | null | null | null | #------------------------------------------------------------------------------
# Name: toc_trends_analysis.py
# Purpose: Analyse RESA2 data for trends.
#
# Author: James Sample
#
# Created: Fri Jul 15 11:35:12 2016
# Copyright: (c) James Sample and NIVA
# Licence:
#--------------------------... | 38.516835 | 118 | 0.517287 |
def mk_test(x, stn_id, par, alpha=0.05):
import numpy as np
from scipy.stats import norm
n = len(x)
if n < 10:
print (' Data series for %s at site %s has fewer than 10 non-null values. '
'Significance estimates may be unreliable.' % (par, int(stn_id)))
... | true | true |
f7118ca81a64318023c6f86e4904b3df0227a3a8 | 468 | py | Python | blogcbv/contrib/sites/migrations/0004_alter_options_ordering_domain.py | saaddine/BlogApp_CookieCutter | 9df5539adae62843c2d41449fe52acfab8e120d5 | [
"MIT"
] | 602 | 2021-10-24T02:17:35.000Z | 2022-03-31T14:45:45.000Z | blogcbv/contrib/sites/migrations/0004_alter_options_ordering_domain.py | saaddine/BlogApp_CookieCutter | 9df5539adae62843c2d41449fe52acfab8e120d5 | [
"MIT"
] | 162 | 2021-10-24T02:31:20.000Z | 2022-03-31T23:39:16.000Z | gestao_rh/contrib/sites/migrations/0004_alter_options_ordering_domain.py | andreFSilva/gestao_rh | 9e0bfce3c594186ed8b9acea12e4dff13337148e | [
"MIT"
] | 204 | 2021-11-02T12:18:07.000Z | 2022-03-31T08:31:53.000Z | # Generated by Django 3.1.7 on 2021-02-04 14:49
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("sites", "0003_set_site_domain_and_name"),
]
operations = [
migrations.AlterModelOptions(
name="site",
options={
... | 21.272727 | 51 | 0.527778 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("sites", "0003_set_site_domain_and_name"),
]
operations = [
migrations.AlterModelOptions(
name="site",
options={
"ordering": ["domain"],
"ve... | true | true |
f7118cb0bdc5e5841720741a7b7171647cf7632a | 2,886 | py | Python | trax/layers/normalization_test.py | zfisher/trax | c8187944fc036418a5c3b0491fc53c223e73faa6 | [
"Apache-2.0"
] | 1 | 2020-04-19T01:40:08.000Z | 2020-04-19T01:40:08.000Z | trax/layers/normalization_test.py | zfisher/trax | c8187944fc036418a5c3b0491fc53c223e73faa6 | [
"Apache-2.0"
] | null | null | null | trax/layers/normalization_test.py | zfisher/trax | c8187944fc036418a5c3b0491fc53c223e73faa6 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Trax 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 a... | 36.075 | 74 | 0.70201 |
from absl.testing import absltest
import numpy as onp
from trax.layers import base
from trax.layers import normalization
from trax.math import numpy as np
from trax.shapes import ShapeDtype
class NormalizationLayerTest(absltest.TestCase):
def test_batch_norm_shape(self):
input_signature = Sha... | true | true |
f7118d0dbc86cd00f058a109d84a4b6e7666a2d7 | 11,575 | py | Python | main.py | chicanica/TeleBot | 5f3c197fea22b812016a31f645db8178d459c4a5 | [
"MIT"
] | null | null | null | main.py | chicanica/TeleBot | 5f3c197fea22b812016a31f645db8178d459c4a5 | [
"MIT"
] | null | null | null | main.py | chicanica/TeleBot | 5f3c197fea22b812016a31f645db8178d459c4a5 | [
"MIT"
] | null | null | null | # Телеграм-бот v.002 - бот создаёт меню, присылает собачку, и анекдот
import telebot # pyTelegramBotAPI 4.3.1
from telebot import types
import requests
import bs4
import json
bot = telebot.TeleBot('5193117811:AAH0hWHVx0kH08sub52IFj2SAdJi1eugY-k') # Создаем экземпляр бота
# ---------------------------------------... | 42.555147 | 149 | 0.539611 |
import telebot
from telebot import types
import requests
import bs4
import json
bot = telebot.TeleBot('5193117811:AAH0hWHVx0kH08sub52IFj2SAdJi1eugY-k')
@bot.message_handler(commands=["start"])
def start(message, res=False):
chat_id = message.chat.id
markup = types.ReplyKeyboardMarkup(resize_keyboar... | true | true |
f7118d7f8a48baf47c123ea7acecff67d1c87396 | 460 | py | Python | meetscheduler/settings/developments.py | leejooy96/meetscheduler | e29a96d5bcaa62a32ae240fb20e85379f37000e5 | [
"MIT"
] | null | null | null | meetscheduler/settings/developments.py | leejooy96/meetscheduler | e29a96d5bcaa62a32ae240fb20e85379f37000e5 | [
"MIT"
] | 6 | 2020-02-13T00:29:51.000Z | 2021-06-10T17:59:43.000Z | meetscheduler/settings/developments.py | leejooy96/meetscheduler | e29a96d5bcaa62a32ae240fb20e85379f37000e5 | [
"MIT"
] | 1 | 2019-12-12T02:19:20.000Z | 2019-12-12T02:19:20.000Z | from .base import *
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': get_value_from_secret('DB_NAME'),
'HOST': get_value_from_secret('DB_HOST'),
'USER': get_value_from_secret('DB_USER'),
'PASSWO... | 27.058824 | 57 | 0.608696 | from .base import *
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': get_value_from_secret('DB_NAME'),
'HOST': get_value_from_secret('DB_HOST'),
'USER': get_value_from_secret('DB_USER'),
'PASSWO... | true | true |
f7118dacceb344ed0d2633d7e6dd0d0119901228 | 5,711 | py | Python | backend/pyrogram/methods/chats/iter_chat_members.py | appheap/social-media-analyzer | 0f9da098bfb0b4f9eb38e0244aa3a168cf97d51c | [
"Apache-2.0"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/methods/chats/iter_chat_members.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/methods/chats/iter_chat_members.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... | 35.69375 | 120 | 0.575031 |
from string import ascii_lowercase
from typing import Union, AsyncGenerator, Optional
from pyrogram import raw
from pyrogram import types
from pyrogram.scaffold import Scaffold
class Filters:
ALL = "all"
KICKED = "kicked"
RESTRICTED = "restricted"
BOTS = "bots"
RECENT = "recent"... | true | true |
f7118e03c63e8796cb463067d621da592fba5da6 | 2,513 | py | Python | stackedcoil/cmulti_c1243_3c.py | anon-coil/coil_gecco | 6b8aa410a944e1db26c3acdc77af71b3b5d4fe74 | [
"MIT"
] | 2 | 2022-02-15T08:39:26.000Z | 2022-02-17T11:51:06.000Z | stackedcoil/cmulti_c1243_3c.py | anon-coil/coil_gecco | 6b8aa410a944e1db26c3acdc77af71b3b5d4fe74 | [
"MIT"
] | null | null | null | stackedcoil/cmulti_c1243_3c.py | anon-coil/coil_gecco | 6b8aa410a944e1db26c3acdc77af71b3b5d4fe74 | [
"MIT"
] | null | null | null | # generate data: specify number of data points generated
NUM_DATA_POINTS = 5000
# the minimum number of variables required for the equation to work
MIN_VARIABLES = 4
# specify objective function
def func(x, num_var):
result = 0.0
for i in range(num_var):
result += x[i]**2
return result
# specify ... | 25.907216 | 102 | 0.670115 |
NUM_DATA_POINTS = 5000
MIN_VARIABLES = 4
def func(x, num_var):
result = 0.0
for i in range(num_var):
result += x[i]**2
return result
MIN_OR_MAX_FLAG = 0
X_MIN_RANGE = -50.0
X_MAX_RANGE = 50.0
def c0(x, num_var):
result = 80 - x[0] - x[1]
if result <= 0.0:
return 0.0
... | true | true |
f7118f37fa1e83d2b81be644d00dbe24bcf186ed | 5,814 | py | Python | file_utils.py | watanka/CRAFTS-implementation | bc514638755fe798a0d5eb583d6d477e8eb55bff | [
"Apache-2.0"
] | 1 | 2021-11-16T15:52:58.000Z | 2021-11-16T15:52:58.000Z | file_utils.py | watanka/CRAFTS-implementation | bc514638755fe798a0d5eb583d6d477e8eb55bff | [
"Apache-2.0"
] | null | null | null | file_utils.py | watanka/CRAFTS-implementation | bc514638755fe798a0d5eb583d6d477e8eb55bff | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import numpy as np
import cv2
import imgproc
from PIL import Image, ImageDraw
# borrowed from https://github.com/lengstrom/fast-style-transfer/blob/master/src/utils.py
def get_files(img_dir):
imgs, masks, xmls = list_files(img_dir)
return imgs, masks, xmls
def list_files(in... | 40.943662 | 136 | 0.484348 |
import os
import numpy as np
import cv2
import imgproc
from PIL import Image, ImageDraw
def get_files(img_dir):
imgs, masks, xmls = list_files(img_dir)
return imgs, masks, xmls
def list_files(in_path):
img_files = []
mask_files = []
gt_files = []
for (dirpath, dirnames, filenames) in os.wa... | true | true |
f7118f84164b64de1d5f666d410c1b51fe89dbb3 | 985 | py | Python | migrations/versions/5b2f27493d7e_.py | NeverLeft/FLASKTPP | 3480131f3386bfc86e45a914f2140949863641dd | [
"Apache-2.0"
] | null | null | null | migrations/versions/5b2f27493d7e_.py | NeverLeft/FLASKTPP | 3480131f3386bfc86e45a914f2140949863641dd | [
"Apache-2.0"
] | null | null | null | migrations/versions/5b2f27493d7e_.py | NeverLeft/FLASKTPP | 3480131f3386bfc86e45a914f2140949863641dd | [
"Apache-2.0"
] | null | null | null | """empty message
Revision ID: 5b2f27493d7e
Revises: 1d17bfa8fe08
Create Date: 2018-06-14 14:54:29.224338
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '5b2f27493d7e'
down_revision = '1d17bfa8fe08'
branch_labels = None
depends_on = None
def upgrade():
# ... | 26.621622 | 65 | 0.675127 | from alembic import op
import sqlalchemy as sa
revision = '5b2f27493d7e'
down_revision = '1d17bfa8fe08'
branch_labels = None
depends_on = None
def upgrade():
nteger(), nullable=True),
sa.Column('mp_time', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['mp_hall'], ['hall.id'], ),
sa.Foreign... | true | true |
f711900c4366c1277c1a4b4099d698e25beaf991 | 5,029 | py | Python | chainer/links/connection/peephole.py | yuhonghong66/chainer | 15d475f54fc39587abd7264808c5e4b33782df9e | [
"MIT"
] | 1 | 2019-02-12T23:10:16.000Z | 2019-02-12T23:10:16.000Z | chainer/links/connection/peephole.py | nolfwin/chainer | 8d776fcc1e848cb9d3800a6aab356eb91ae9d088 | [
"MIT"
] | 2 | 2019-05-14T15:45:01.000Z | 2019-05-15T07:12:49.000Z | chainer/links/connection/peephole.py | nolfwin/chainer | 8d776fcc1e848cb9d3800a6aab356eb91ae9d088 | [
"MIT"
] | 1 | 2018-05-28T22:43:34.000Z | 2018-05-28T22:43:34.000Z | import chainer
from chainer.backends import cuda
from chainer.functions.activation import sigmoid
from chainer.functions.activation import tanh
from chainer.functions.array import reshape
from chainer.functions.array import split_axis
from chainer import link
from chainer.links.connection import linear
from chainer imp... | 39.289063 | 78 | 0.601114 | import chainer
from chainer.backends import cuda
from chainer.functions.activation import sigmoid
from chainer.functions.activation import tanh
from chainer.functions.array import reshape
from chainer.functions.array import split_axis
from chainer import link
from chainer.links.connection import linear
from chainer imp... | true | true |
f71190292a7421e463a92607ba0d07147a7f68d5 | 3,338 | py | Python | xenia_python_client_library/models/organization_user_update.py | DutchAnalytics/xenia-python-client-library | 60dc3e21094086124b552ff5bed5895fee826b57 | [
"Apache-2.0"
] | null | null | null | xenia_python_client_library/models/organization_user_update.py | DutchAnalytics/xenia-python-client-library | 60dc3e21094086124b552ff5bed5895fee826b57 | [
"Apache-2.0"
] | null | null | null | xenia_python_client_library/models/organization_user_update.py | DutchAnalytics/xenia-python-client-library | 60dc3e21094086124b552ff5bed5895fee826b57 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Xenia Python Client Library
Python Client Library to interact with the Xenia API. # noqa: E501
The version of the OpenAPI document: v2.1
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from xenia_python_client_library.configur... | 27.586777 | 81 | 0.579089 |
import pprint
import re
import six
from xenia_python_client_library.configuration import Configuration
class OrganizationUserUpdate(object):
openapi_types = {
'admin': 'bool'
}
attribute_map = {
'admin': 'admin'
}
def __init__(self, admin=False, local_vars_configuration=... | true | true |
f71192f1a6d47ff40b424445a4968b83f2e91a89 | 9,469 | py | Python | tests/test_generate_files.py | bittner/cookiecutter | 3a3f4b247a5f5f326a614907ba915af773791fdf | [
"BSD-3-Clause"
] | 1 | 2020-12-19T08:02:33.000Z | 2020-12-19T08:02:33.000Z | tests/test_generate_files.py | imbi7py/cookiecutter | 7f4bc4929ec6dc4e77b389d698b576b8a089a091 | [
"BSD-3-Clause"
] | null | null | null | tests/test_generate_files.py | imbi7py/cookiecutter | 7f4bc4929ec6dc4e77b389d698b576b8a089a091 | [
"BSD-3-Clause"
] | 1 | 2020-01-15T16:44:21.000Z | 2020-01-15T16:44:21.000Z | # -*- coding: utf-8 -*-
"""
test_generate_files
-------------------
Tests formerly known from a unittest residing in test_generate.py named
TestGenerateFiles.test_generate_files_nontemplated_exception
TestGenerateFiles.test_generate_files
TestGenerateFiles.test_generate_files_with_trailing_newline
TestGenerateFiles.t... | 32.317406 | 78 | 0.699018 |
from __future__ import unicode_literals
import os
import io
import pytest
from cookiecutter import generate
from cookiecutter import exceptions
from cookiecutter import utils
@pytest.mark.parametrize('invalid_dirname', ['', '{foo}', '{{foo', 'bar}}'])
def test_ensure_dir_is_templated_raises(invalid_dirname):
... | true | true |
f71192fabb5e746aede1a9c9b5b7d8a1f18a4159 | 4,888 | py | Python | torch/jit/_monkeytype_config.py | rpindale/pytorch | b07264301d19869ab223957a15e2ce8825886d21 | [
"Intel"
] | 1 | 2021-06-21T09:43:33.000Z | 2021-06-21T09:43:33.000Z | torch/jit/_monkeytype_config.py | rpindale/pytorch | b07264301d19869ab223957a15e2ce8825886d21 | [
"Intel"
] | null | null | null | torch/jit/_monkeytype_config.py | rpindale/pytorch | b07264301d19869ab223957a15e2ce8825886d21 | [
"Intel"
] | null | null | null | import inspect
import typing
import torch
from typing import Optional, Iterable, List, Dict
from collections import defaultdict
_IS_MONKEYTYPE_INSTALLED = True
try:
import monkeytype # type: ignore[import]
from monkeytype import trace as monkeytype_trace
from monkeytype.db.base import CallTraceThunk, Call... | 38.488189 | 111 | 0.594926 | import inspect
import typing
import torch
from typing import Optional, Iterable, List, Dict
from collections import defaultdict
_IS_MONKEYTYPE_INSTALLED = True
try:
import monkeytype
from monkeytype import trace as monkeytype_trace
from monkeytype.db.base import CallTraceThunk, CallTraceStore, CallTraceS... | true | true |
f71193d757e833203e1e5b18a48ec2bdf4f531a0 | 1,029 | py | Python | edu/class8/config.py | h1063135843/PaddleViT | 6f150b82d801b082cc7af09af396bfe2f6bf9987 | [
"Apache-2.0"
] | 1 | 2021-12-12T12:34:01.000Z | 2021-12-12T12:34:01.000Z | edu/class8/config.py | h1063135843/PaddleViT | 6f150b82d801b082cc7af09af396bfe2f6bf9987 | [
"Apache-2.0"
] | null | null | null | edu/class8/config.py | h1063135843/PaddleViT | 6f150b82d801b082cc7af09af396bfe2f6bf9987 | [
"Apache-2.0"
] | null | null | null | from yacs.config import CfgNode as CN
import yaml
_C = CN()
_C.DATA = CN()
_C.DATA.DATASET = 'Cifar10'
_C.DATA.BATCH_SIZE = 128
_C.MODEL = CN()
_C.MODEL.NUM_CLASSES = 1000
_C.MODEL.TRANS = CN()
_C.MODEL.TRANS.EMBED_DIM = 96
_C.MODEL.TRANS.DEPTHS = [2, 2, 6, 2]
_C.MODEL.TRANS.QKV_BIAS = False
def _update_config_fr... | 18.709091 | 50 | 0.665695 | from yacs.config import CfgNode as CN
import yaml
_C = CN()
_C.DATA = CN()
_C.DATA.DATASET = 'Cifar10'
_C.DATA.BATCH_SIZE = 128
_C.MODEL = CN()
_C.MODEL.NUM_CLASSES = 1000
_C.MODEL.TRANS = CN()
_C.MODEL.TRANS.EMBED_DIM = 96
_C.MODEL.TRANS.DEPTHS = [2, 2, 6, 2]
_C.MODEL.TRANS.QKV_BIAS = False
def _update_config_fr... | true | true |
f71193ef3fbfbec2cf3575c19fdbffbc9b4086b6 | 7,520 | py | Python | test/integration/ggrc/review/test_api.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc/review/test_api.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc/review/test_api.py | sfarbotka/ggrc-core | ef7aae6bc09ad2f53a2414f643572e07d689784a | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-02-13T12:32:45.000Z | 2020-02-13T12:32:45.000Z | # Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Base TestCase for proposal api."""
import ddt
from ggrc.models import all_models
from integration.ggrc import TestCase, generator
from integration.ggrc.models import factories
from integration.ggrc.api... | 34.814815 | 79 | 0.648404 |
import ddt
from ggrc.models import all_models
from integration.ggrc import TestCase, generator
from integration.ggrc.models import factories
from integration.ggrc.api_helper import Api
from integration.ggrc.review import build_reviewer_acl
@ddt.ddt
class TestReviewApi(TestCase):
def setUp(self):
super(Te... | true | true |
f7119443cc493f06975a851156fbc3ec8010dca5 | 998 | py | Python | flaskr/__init__.py | wiky-avis/flask_app | 7ea6964bb9dcd4a919161d062ddaff2a3c20ae43 | [
"MIT"
] | null | null | null | flaskr/__init__.py | wiky-avis/flask_app | 7ea6964bb9dcd4a919161d062ddaff2a3c20ae43 | [
"MIT"
] | null | null | null | flaskr/__init__.py | wiky-avis/flask_app | 7ea6964bb9dcd4a919161d062ddaff2a3c20ae43 | [
"MIT"
] | 1 | 2021-07-15T08:39:17.000Z | 2021-07-15T08:39:17.000Z | import os
from flask import Flask
def create_app(test_config=None):
# create and configure the app
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY='dev',
DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
)
if test_config is None:
... | 23.209302 | 66 | 0.650301 | import os
from flask import Flask
def create_app(test_config=None):
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY='dev',
DATABASE=os.path.join(app.instance_path, 'flaskr.sqlite'),
)
if test_config is None:
app.config.fr... | true | true |
f7119504da3f4521c3aee2052b77a4d48632efc2 | 8,573 | py | Python | json_commander.py | LairdCP/BT510-Python | a7c5b2825a3919b3b261524763ec0a5ed76d54da | [
"Apache-2.0"
] | 1 | 2021-05-16T17:53:33.000Z | 2021-05-16T17:53:33.000Z | json_commander.py | LairdCP/BT510-Python | a7c5b2825a3919b3b261524763ec0a5ed76d54da | [
"Apache-2.0"
] | null | null | null | json_commander.py | LairdCP/BT510-Python | a7c5b2825a3919b3b261524763ec0a5ed76d54da | [
"Apache-2.0"
] | 1 | 2021-04-23T22:33:21.000Z | 2021-04-23T22:33:21.000Z |
"""
BT510 commands (serial or BLE).
This is a subset of the jtester commands used for verification.
"""
import time
import json
import random
import string
import logging
from jsonrpcclient.requests import Request
class jtester:
def __init__(self, fname="config.json"):
""" JSON tester that is independen... | 32.721374 | 73 | 0.523737 |
import time
import json
import random
import string
import logging
from jsonrpcclient.requests import Request
class jtester:
def __init__(self, fname="config.json"):
print("jtester init")
self.protocol = None
self.inter_message_delay = 0.01
self.reset_delay = 10
self.rese... | true | true |
f711955d7814146fa3409fdcd71c37026ca25fdd | 11,405 | py | Python | augmentation/methods/cyclegan/utils.py | SaraR-1/model-patching | 97b30bad4bb4575a5f3a4cc23fbd333b10a057a8 | [
"Apache-2.0"
] | 28 | 2020-08-19T02:59:37.000Z | 2022-03-17T18:10:24.000Z | augmentation/methods/cyclegan/utils.py | SaraR-1/model-patching | 97b30bad4bb4575a5f3a4cc23fbd333b10a057a8 | [
"Apache-2.0"
] | null | null | null | augmentation/methods/cyclegan/utils.py | SaraR-1/model-patching | 97b30bad4bb4575a5f3a4cc23fbd333b10a057a8 | [
"Apache-2.0"
] | 3 | 2021-01-29T10:20:14.000Z | 2021-11-15T17:06:27.000Z | import datetime
import tensorflow as tf
import random
import wandb
from tensorflow_examples.models.pix2pix import pix2pix
from augmentation.dataflows.utils import create_paired_direct_dataflow, \
create_paired_parallel_dataflow_via_numpy
from augmentation.methods.cyclegan.models import mnist_unet_generator, mnist... | 41.624088 | 128 | 0.635949 | import datetime
import tensorflow as tf
import random
import wandb
from tensorflow_examples.models.pix2pix import pix2pix
from augmentation.dataflows.utils import create_paired_direct_dataflow, \
create_paired_parallel_dataflow_via_numpy
from augmentation.methods.cyclegan.models import mnist_unet_generator, mnist... | true | true |
f71195d43ec5aff59399866c4085c5cb7a9cb696 | 433 | py | Python | collect.py | foamliu/Facial-Expression-Prediction-v2 | cb29f7cfbc2136e13adc2b35bbff95fdfbe063f6 | [
"MIT"
] | 4 | 2019-09-17T10:00:51.000Z | 2021-04-24T03:10:43.000Z | collect.py | foamliu/Facial-Expression-Prediction-v2 | cb29f7cfbc2136e13adc2b35bbff95fdfbe063f6 | [
"MIT"
] | 1 | 2019-09-26T08:08:41.000Z | 2019-09-26T08:22:08.000Z | collect.py | foamliu/Facial-Expression-Prediction-v2 | cb29f7cfbc2136e13adc2b35bbff95fdfbe063f6 | [
"MIT"
] | null | null | null | import pickle
import cv2 as cv
if __name__ == "__main__":
with open('fer2013.pkl', 'rb') as file:
data = pickle.load(file)
train = data['train']
train = train[:10]
for i, sample in enumerate(train):
filename = sample['image_path']
img = cv.imread(filename)
new_name = ... | 22.789474 | 44 | 0.581986 | import pickle
import cv2 as cv
if __name__ == "__main__":
with open('fer2013.pkl', 'rb') as file:
data = pickle.load(file)
train = data['train']
train = train[:10]
for i, sample in enumerate(train):
filename = sample['image_path']
img = cv.imread(filename)
new_name = ... | true | true |
f711965dc8523212746c3ea30163a0260f421dd0 | 24 | py | Python | torchlight/xp/__init__.py | l3robot/torchlight | e9a809aad0b5e75f97bf0cb50c9c799ea7b98eab | [
"MIT"
] | null | null | null | torchlight/xp/__init__.py | l3robot/torchlight | e9a809aad0b5e75f97bf0cb50c9c799ea7b98eab | [
"MIT"
] | null | null | null | torchlight/xp/__init__.py | l3robot/torchlight | e9a809aad0b5e75f97bf0cb50c9c799ea7b98eab | [
"MIT"
] | null | null | null | from .splitter import *
| 12 | 23 | 0.75 | from .splitter import *
| true | true |
f71199626d1f05e87cb35c323e9b5e8cccb1c230 | 1,888 | py | Python | tuiuiu/tuiuiutenant/migration_executors/base.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | 3 | 2019-08-08T09:09:35.000Z | 2020-12-15T18:04:17.000Z | tuiuiu/tuiuiutenant/migration_executors/base.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | null | null | null | tuiuiu/tuiuiutenant/migration_executors/base.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | 1 | 2017-09-09T20:10:40.000Z | 2017-09-09T20:10:40.000Z | import sys
from django.core.management.commands.migrate import Command as MigrateCommand
from django.db import transaction
from tuiuiu.tuiuiutenant.utils import get_public_schema_name
def run_migrations(args, options, executor_codename, schema_name, allow_atomic=True):
from django.core.management import color
... | 29.046154 | 86 | 0.692797 | import sys
from django.core.management.commands.migrate import Command as MigrateCommand
from django.db import transaction
from tuiuiu.tuiuiutenant.utils import get_public_schema_name
def run_migrations(args, options, executor_codename, schema_name, allow_atomic=True):
from django.core.management import color
... | true | true |
f7119983a202a347052dbee89c37d91f383faf43 | 904 | py | Python | qiskit_machine_learning/algorithms/distribution_learners/__init__.py | Zoufalc/qiskit-machine-learning | aae3941214cd9667a53b643f229d11d0bff32c60 | [
"Apache-2.0"
] | 1 | 2021-07-07T21:23:38.000Z | 2021-07-07T21:23:38.000Z | qiskit_machine_learning/algorithms/distribution_learners/__init__.py | Zoufalc/qiskit-machine-learning | aae3941214cd9667a53b643f229d11d0bff32c60 | [
"Apache-2.0"
] | null | null | null | qiskit_machine_learning/algorithms/distribution_learners/__init__.py | Zoufalc/qiskit-machine-learning | aae3941214cd9667a53b643f229d11d0bff32c60 | [
"Apache-2.0"
] | 1 | 2021-04-11T14:30:32.000Z | 2021-04-11T14:30:32.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 30.133333 | 77 | 0.670354 |
from .qgan import (DiscriminativeNetwork,
GenerativeNetwork,
NumPyDiscriminator,
PyTorchDiscriminator,
QuantumGenerator,
QGAN)
__all__ = [
'DiscriminativeNetwork',
'GenerativeNetwork',
'NumPyDiscrimi... | true | true |
f7119988b8ce9a26197da88008895fe3d1beeded | 908 | py | Python | image_converter/urls.py | dumrauf/web_tools | df2efff4c3435bfb2df131a6de572ecd50cc034d | [
"MIT"
] | null | null | null | image_converter/urls.py | dumrauf/web_tools | df2efff4c3435bfb2df131a6de572ecd50cc034d | [
"MIT"
] | null | null | null | image_converter/urls.py | dumrauf/web_tools | df2efff4c3435bfb2df131a6de572ecd50cc034d | [
"MIT"
] | null | null | null | """web_tools URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | 34.923077 | 82 | 0.73348 | from django.conf.urls import url, include
from django.contrib import admin
from image_converter.views import upload_and_convert_image_file
__author__ = 'dominic'
urlpatterns = [
url(r'', upload_and_convert_image_file, name='upload_and_convert_image_file'),
]
| true | true |
f7119aad378282c16b985f4ad98bfd62252bbb62 | 22 | py | Python | builtinUI/__init__.py | BlackCatDevel0per/s2txt | fe1cf551057be5777eb8f27e9d56dd2ae3cbb514 | [
"Apache-2.0"
] | null | null | null | builtinUI/__init__.py | BlackCatDevel0per/s2txt | fe1cf551057be5777eb8f27e9d56dd2ae3cbb514 | [
"Apache-2.0"
] | null | null | null | builtinUI/__init__.py | BlackCatDevel0per/s2txt | fe1cf551057be5777eb8f27e9d56dd2ae3cbb514 | [
"Apache-2.0"
] | null | null | null | from .main import UIS
| 11 | 21 | 0.772727 | from .main import UIS
| true | true |
f7119b37d5164e1883c48596812221294dc20231 | 906 | py | Python | pws/asymmetric/rsa/helpers.py | pqlx/pws-crypto | 23dcf59d0b37d811d0a9bda995a3ea7d09051416 | [
"MIT"
] | 1 | 2020-12-10T01:14:29.000Z | 2020-12-10T01:14:29.000Z | pws/asymmetric/rsa/helpers.py | pqlx/pws-crypto | 23dcf59d0b37d811d0a9bda995a3ea7d09051416 | [
"MIT"
] | null | null | null | pws/asymmetric/rsa/helpers.py | pqlx/pws-crypto | 23dcf59d0b37d811d0a9bda995a3ea7d09051416 | [
"MIT"
] | null | null | null | from typing import Union
import math
AbstractText = Union[int, bytes]
def byte_length(i: int) -> int:
"""Returns the minimal amount of bytes needed to represent unsigned integer `i`."""
# we need to add 1 to correct the fact that a byte can only go up to 255, instead of 256:
# i.e math.log(0x100, 0x1... | 32.357143 | 96 | 0.677704 | from typing import Union
import math
AbstractText = Union[int, bytes]
def byte_length(i: int) -> int:
return math.ceil(math.log(i + 1, 0x100))
def bit_length(i: int) -> int:
return math.ceil(math.log(i + 1, 2))
def int_to_bytes(i: int, length: int=-1) -> bytes:
return i.to_bytes(byte_le... | true | true |
f7119bbdc9310255f89817b25365b0356a1b07f4 | 960 | py | Python | lib/galaxy/jobs/runners/lwr_client/transport/__init__.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 1 | 2016-08-17T06:36:03.000Z | 2016-08-17T06:36:03.000Z | lib/galaxy/jobs/runners/lwr_client/transport/__init__.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 1 | 2015-02-21T18:48:19.000Z | 2015-02-27T15:50:32.000Z | lib/galaxy/jobs/runners/lwr_client/transport/__init__.py | blankenberg/galaxy-data-resource | ca32a1aafd64948f489a4e5cf88096f32391b1d9 | [
"CC-BY-3.0"
] | 3 | 2015-02-22T13:34:16.000Z | 2020-10-01T01:28:04.000Z | from .standard import Urllib2Transport
from .curl import PycurlTransport
import os
def get_transport(transport_type=None, os_module=os):
transport_type = __get_transport_type(transport_type, os_module)
if transport_type == 'urllib':
transport = Urllib2Transport()
else:
transport = PycurlTr... | 30 | 68 | 0.713542 | from .standard import Urllib2Transport
from .curl import PycurlTransport
import os
def get_transport(transport_type=None, os_module=os):
transport_type = __get_transport_type(transport_type, os_module)
if transport_type == 'urllib':
transport = Urllib2Transport()
else:
transport = PycurlTr... | true | true |
f7119cd11533daac3bec25c889502995c3aaed94 | 2,212 | py | Python | api/contests/migrations/0001_squashed_0003_auto_20200410_1511.py | selelab/contests | 5a239e306aeb84882fdee56ed8ba64721308cbb6 | [
"MIT"
] | null | null | null | api/contests/migrations/0001_squashed_0003_auto_20200410_1511.py | selelab/contests | 5a239e306aeb84882fdee56ed8ba64721308cbb6 | [
"MIT"
] | 6 | 2021-06-04T22:53:39.000Z | 2022-02-18T23:53:51.000Z | api/contests/migrations/0001_squashed_0003_auto_20200410_1511.py | selelab/contests | 5a239e306aeb84882fdee56ed8ba64721308cbb6 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-04-11 03:48
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
replaces = [('contests', '0001_initial'), ('contests', '0002_auto_20200410_1324'), ('contests', '0003_auto_20200410_1511')]
initial = ... | 34.5625 | 127 | 0.529385 |
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
replaces = [('contests', '0001_initial'), ('contests', '0002_auto_20200410_1324'), ('contests', '0003_auto_20200410_1511')]
initial = True
dependencies = [
]
operation... | true | true |
f7119d599e25a3f54a577d53867e596bb48c317c | 1,556 | py | Python | azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag.py | bulentelmaci/azure-sdk-for-python | 9723d1baf6dde51c069e172ff0f21eb925d362f1 | [
"MIT"
] | null | null | null | azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag.py | bulentelmaci/azure-sdk-for-python | 9723d1baf6dde51c069e172ff0f21eb925d362f1 | [
"MIT"
] | null | null | null | azure-cognitiveservices-vision-customvision/azure/cognitiveservices/vision/customvision/training/models/tag.py | bulentelmaci/azure-sdk-for-python | 9723d1baf6dde51c069e172ff0f21eb925d362f1 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 31.755102 | 76 | 0.568123 |
from msrest.serialization import Model
class Tag(Model):
_validation = {
'id': {'readonly': True},
'image_count': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'Id', 'type': 'str'},
'name': {'key': 'Name', 'type': 'str'},
'description': {'key':... | true | true |
f7119d7c59ca6eac52878c1e416f7ea7327c9543 | 4,445 | py | Python | IOTSocket/IOTSocketClient.py | AbhijithAJ/IOTSocket | 1a27c12491edc31b1c4fab8bcda34c643a5ef21c | [
"MIT"
] | 51 | 2020-02-19T16:46:32.000Z | 2022-03-19T08:51:35.000Z | IOTSocket/IOTSocketClient.py | AbhijithAJ/IOTSocket | 1a27c12491edc31b1c4fab8bcda34c643a5ef21c | [
"MIT"
] | null | null | null | IOTSocket/IOTSocketClient.py | AbhijithAJ/IOTSocket | 1a27c12491edc31b1c4fab8bcda34c643a5ef21c | [
"MIT"
] | 6 | 2020-02-19T16:46:43.000Z | 2021-11-23T13:37:03.000Z | '''
Developed by Abhijith Boppe - linkedin.com/in/abhijith-boppe/
'''
import socket
import ssl
import time
data_maxLength = 65535
fields_maxLength =1024
sock = ''
device_id = ''
device_key = ''
time_stamps = []
def connectionSet(host, port, id_, key, Encrypt=1, cert_path=None):
global sock, device_id, device_key... | 36.434426 | 142 | 0.575928 | import socket
import ssl
import time
data_maxLength = 65535
fields_maxLength =1024
sock = ''
device_id = ''
device_key = ''
time_stamps = []
def connectionSet(host, port, id_, key, Encrypt=1, cert_path=None):
global sock, device_id, device_key, time_stamps
device_id = id_
device_key = key
time_stamps ... | true | true |
f7119ee2963ec0639fd70a9f4c454952354ead62 | 299 | py | Python | arrow/commands/cannedvalues/findAllValues.py | trstickland/python-apollo | 04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb | [
"MIT"
] | null | null | null | arrow/commands/cannedvalues/findAllValues.py | trstickland/python-apollo | 04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb | [
"MIT"
] | null | null | null | arrow/commands/cannedvalues/findAllValues.py | trstickland/python-apollo | 04cccf2923e6977b2cfb6ebb2ff7e5227b740bcb | [
"MIT"
] | null | null | null | import click
from arrow.cli import pass_context
from arrow.decorators import custom_exception, dict_output
@click.command('findAllValues')
@pass_context
@custom_exception
@dict_output
def cli(ctx):
"""TODO: Undocumented
Output:
???
"""
return ctx.gi.cannedvalues.findAllValues()
| 16.611111 | 58 | 0.749164 | import click
from arrow.cli import pass_context
from arrow.decorators import custom_exception, dict_output
@click.command('findAllValues')
@pass_context
@custom_exception
@dict_output
def cli(ctx):
return ctx.gi.cannedvalues.findAllValues()
| true | true |
f7119f18095bc966c56c2eadd6c672d850c9ddfc | 828 | py | Python | tests/models/test_deployment.py | Hydrospheredata/mist-cli | 1eb6b2c660e5c1718ecaa5b58648821d9cacc6a9 | [
"Apache-2.0"
] | 3 | 2017-10-12T13:04:10.000Z | 2018-08-06T08:37:04.000Z | tests/models/test_deployment.py | Hydrospheredata/mist-cli | 1eb6b2c660e5c1718ecaa5b58648821d9cacc6a9 | [
"Apache-2.0"
] | 20 | 2017-10-05T13:40:36.000Z | 2019-09-05T13:56:01.000Z | tests/models/test_deployment.py | Hydrospheredata/mist-cli | 1eb6b2c660e5c1718ecaa5b58648821d9cacc6a9 | [
"Apache-2.0"
] | 5 | 2018-01-28T09:55:24.000Z | 2021-10-04T06:30:34.000Z | from unittest import TestCase
from pyhocon import ConfigTree
from mist.models import Deployment
class DeploymentTest(TestCase):
def test_create_deployment(self):
Deployment('test', 'Artifact', ConfigTree(), '0.0.1')
def test_get_name(self):
d = Deployment('test', 'Artifact', ConfigTree({
... | 29.571429 | 67 | 0.612319 | from unittest import TestCase
from pyhocon import ConfigTree
from mist.models import Deployment
class DeploymentTest(TestCase):
def test_create_deployment(self):
Deployment('test', 'Artifact', ConfigTree(), '0.0.1')
def test_get_name(self):
d = Deployment('test', 'Artifact', ConfigTree({
... | true | true |
f7119f62d7de298128757da8c1cef7e04a214f8c | 2,449 | py | Python | examples/AdafruitDHT.py | rewisyoung/Adafruit_Python_DHT | d3f525fea0ed2b5dc899eb1584015b6bd092a46a | [
"MIT"
] | null | null | null | examples/AdafruitDHT.py | rewisyoung/Adafruit_Python_DHT | d3f525fea0ed2b5dc899eb1584015b6bd092a46a | [
"MIT"
] | null | null | null | examples/AdafruitDHT.py | rewisyoung/Adafruit_Python_DHT | d3f525fea0ed2b5dc899eb1584015b6bd092a46a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
... | 41.508475 | 98 | 0.740302 |
import sys
import Adafruit_DHT
import time
sensor_args = { '11': Adafruit_DHT.DHT11,
'22': Adafruit_DHT.DHT22,
'2302': Adafruit_DHT.AM2302 }
if len(sys.argv) == 3 and sys.argv[1] in sensor_args:
sensor = sensor_args[sys.argv[1]]
pin = sys.argv[2]
else:
... | true | true |
f7119fbceb12284f90eb8b90d388f4fb365e1026 | 510 | py | Python | leetcode/053/53.py | shankar-shiv/CS1010E_Kattis_practice | 9a8597b7ab61d5afa108a8b943ca2bb3603180c6 | [
"MIT"
] | null | null | null | leetcode/053/53.py | shankar-shiv/CS1010E_Kattis_practice | 9a8597b7ab61d5afa108a8b943ca2bb3603180c6 | [
"MIT"
] | null | null | null | leetcode/053/53.py | shankar-shiv/CS1010E_Kattis_practice | 9a8597b7ab61d5afa108a8b943ca2bb3603180c6 | [
"MIT"
] | null | null | null | '''The thought follows a simple rule:
If the sum of a subarray is positive, it has possible to make the next value bigger, so we keep do it until it turn to negative.
If the sum is negative, it has no use to the next element, so we break.
it is a game of sum, not the elements.'''
nums = [-2, 1, -3, 4, -1, 2, 1, -5, 4... | 26.842105 | 128 | 0.615686 |
nums = [-2, 1, -3, 4, -1, 2, 1, -5, 4]
def Solution(nums):
for i in range(1, len(nums)):
if nums[i - 1] > 0:
nums[i] += nums[i - 1]
print(nums)
return max(nums)
print(Solution(nums))
| true | true |
f7119fd3687878f90fc548a161cfe2f3cf9d90a5 | 12,909 | py | Python | tools/intogen/runtime/pyenv/lib/python2.7/site-packages/scipy/sparse/linalg/isolve/lsmr.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | 1 | 2021-02-05T13:19:58.000Z | 2021-02-05T13:19:58.000Z | tools/intogen/runtime/pyenv/lib/python2.7/site-packages/scipy/sparse/linalg/isolve/lsmr.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | 1 | 2018-04-15T22:59:15.000Z | 2018-04-15T22:59:15.000Z | tools/intogen/runtime/pyenv/lib/python2.7/site-packages/scipy/sparse/linalg/isolve/lsmr.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | null | null | null | """
Copyright (C) 2010 David Fong and Michael Saunders
LSMR uses an iterative method.
07 Jun 2010: Documentation updated
03 Jun 2010: First release version in Python
David Chin-lung Fong clfong@stanford.edu
Institute for Computational and Mathematical Engineering
Stanford University
Michael Saunders ... | 31.874074 | 79 | 0.539778 |
from __future__ import division, print_function, absolute_import
__all__ = ['lsmr']
from numpy import zeros, infty
from numpy.linalg import norm
from math import sqrt
from scipy.sparse.linalg.interface import aslinearoperator
from .lsqr import _sym_ortho
def lsmr(A, b, damp=0.0, atol=1e-6, btol=1e-6, conlim=1e8,
... | true | true |
f711a06a366032c815f82e1ea837be756e3e5b25 | 36,627 | py | Python | .modules/.sqlmap/lib/core/settings.py | termux-one/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 1,103 | 2018-04-20T14:08:11.000Z | 2022-03-29T06:22:43.000Z | .modules/.sqlmap/lib/core/settings.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 29 | 2019-04-03T14:52:38.000Z | 2022-03-24T12:33:05.000Z | .modules/.sqlmap/lib/core/settings.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 161 | 2018-04-20T15:57:12.000Z | 2022-03-15T19:16:16.000Z | #!/usr/bin/env python
"""
Copyright (c) 2006-2018 sqlmap developers (http://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import os
import random
import re
import subprocess
import string
import sys
import types
from lib.core.datatype import AttribDict
from lib.core.enums import DBMS
from lib.core.e... | 45.499379 | 1,450 | 0.72523 |
import os
import random
import re
import subprocess
import string
import sys
import types
from lib.core.datatype import AttribDict
from lib.core.enums import DBMS
from lib.core.enums import DBMS_DIRECTORY_NAME
from lib.core.enums import OS
VERSION = "1.2.11.12"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.s... | true | true |
f711a1707f5dbf4044a9357dbfc2ae691a4ada14 | 5,598 | py | Python | mechamodlearn/rigidbody.py | sisl/mechamodlearn | ed514b5d1193ce546b0221ba9222b0228d6c319a | [
"MIT"
] | 22 | 2019-02-22T00:11:55.000Z | 2022-01-01T22:13:17.000Z | mechamodlearn/rigidbody.py | sisl/mechamodlearn | ed514b5d1193ce546b0221ba9222b0228d6c319a | [
"MIT"
] | 2 | 2019-04-12T05:17:53.000Z | 2021-04-14T21:12:59.000Z | mechamodlearn/rigidbody.py | sisl/mechamodlearn | ed514b5d1193ce546b0221ba9222b0228d6c319a | [
"MIT"
] | 5 | 2019-06-10T14:28:26.000Z | 2019-12-06T02:03:21.000Z | # File: rigidbody.py
import abc
import torch
from mechamodlearn import nn, utils
from mechamodlearn.models import CholeskyMMNet, PotentialNet, GeneralizedForceNet
class AbstractRigidBody:
@property
@abc.abstractmethod
def thetamask(self):
"""Returns theta mask for configuration q.
These... | 30.096774 | 100 | 0.576099 |
import abc
import torch
from mechamodlearn import nn, utils
from mechamodlearn.models import CholeskyMMNet, PotentialNet, GeneralizedForceNet
class AbstractRigidBody:
@property
@abc.abstractmethod
def thetamask(self):
@abc.abstractmethod
def mass_matrix(self, q):
@abc.abstractmethod
... | true | true |
f711a20ba72a69cc04b9b1a002911d1710c385ab | 9,423 | py | Python | fiftyone/core/validation.py | williamcorsel/fiftyone | 22e34e91deb1d2e2fe6316ec81714e0c55015523 | [
"Apache-2.0"
] | null | null | null | fiftyone/core/validation.py | williamcorsel/fiftyone | 22e34e91deb1d2e2fe6316ec81714e0c55015523 | [
"Apache-2.0"
] | null | null | null | fiftyone/core/validation.py | williamcorsel/fiftyone | 22e34e91deb1d2e2fe6316ec81714e0c55015523 | [
"Apache-2.0"
] | null | null | null | """
Validation utilities.
| Copyright 2017-2022, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import eta.core.utils as etau
import fiftyone.core.media as fom
import fiftyone.core.utils as fou
foc = fou.lazy_import("fiftyone.core.collections")
fov = fou.lazy_import("fiftyone.core.video")
def validate... | 30.299035 | 79 | 0.632495 | import eta.core.utils as etau
import fiftyone.core.media as fom
import fiftyone.core.utils as fou
foc = fou.lazy_import("fiftyone.core.collections")
fov = fou.lazy_import("fiftyone.core.video")
def validate_image_sample(sample):
if sample.media_type != fom.IMAGE:
raise ValueError(
"Expected ... | true | true |
f711a2afb6e9dd431868b09d890d7264429b6980 | 31,867 | py | Python | venv/lib/python3.6/tempfile.py | KorynLA/dwellinglyapi | 752d9aff1b203966df04de38caad2fd3e885a512 | [
"MIT"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | venv/lib/python3.6/tempfile.py | KorynLA/dwellinglyapi | 752d9aff1b203966df04de38caad2fd3e885a512 | [
"MIT"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | venv/lib/python3.6/tempfile.py | KorynLA/dwellinglyapi | 752d9aff1b203966df04de38caad2fd3e885a512 | [
"MIT"
] | 1 | 2020-07-17T12:49:49.000Z | 2020-07-17T12:49:49.000Z | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. All of the interfaces
provided by this module can be used without fear of race conditions
except for 'mktemp'. 'mktemp' is subject to race conditions and
should not be used; it is provided f... | 33.438615 | 80 | 0.600151 |
__all__ = [
"NamedTemporaryFile", "TemporaryFile",
"SpooledTemporaryFile", "TemporaryDirectory",
"mkstemp", "mkdtemp",
"mktemp",
"TMP_MAX", "gettempprefix",
"tempdir", "gettempdir",
"gettempprefixb", "gettempdirb",
]
import... | true | true |
f711a4bb1a6410ceb126fa5124c0048c868bc502 | 958 | py | Python | Records/admin.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-12-22T13:11:12.000Z | 2021-12-22T13:11:12.000Z | Records/admin.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | 9 | 2020-10-28T07:07:05.000Z | 2021-06-28T20:05:37.000Z | Records/admin.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019-2021 Ramon van der Winkel.
# All rights reserved.
# Licensed under BSD-3-Clause-Clear. See LICENSE file for details.
from django.contrib import admin
from .models import IndivRecord, BesteIndivRecords
class IndivRecordAdmin(admin.ModelAdmin):
""" Admin configurat... | 28.176471 | 101 | 0.726514 |
from django.contrib import admin
from .models import IndivRecord, BesteIndivRecords
class IndivRecordAdmin(admin.ModelAdmin):
search_fields = ('naam', 'plaats', 'score', 'volg_nr')
list_filter = ('discipline', 'soort_record', 'geslacht', 'leeftijdscategorie', 'materiaalklasse',
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.