hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c42999c62d09208aa34aeb2620c85b895a68692 | 133,787 | py | Python | neutron/tests/unit/agent/test_securitygroups_rpc.py | mail2nsrajesh/neutron | 352afb37afcf4952f03436b25618d0066c51f3f1 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/agent/test_securitygroups_rpc.py | mail2nsrajesh/neutron | 352afb37afcf4952f03436b25618d0066c51f3f1 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/agent/test_securitygroups_rpc.py | mail2nsrajesh/neutron | 352afb37afcf4952f03436b25618d0066c51f3f1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012, Nachi Ueno, NTT MCL, Inc.
# 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
#
# Unles... | 45.786105 | 79 | 0.605687 |
import collections
import contextlib
import mock
import netaddr
from neutron_lib import constants as const
from neutron_lib import context
from neutron_lib.plugins import directory
from oslo_config import cfg
import oslo_messaging
from testtools import matchers
import webob.exc
from neutron.agent impor... | true | true |
1c429bafa9a19f7c83fd8e02eb564e6443c7c7f2 | 128,741 | py | Python | env/lib/python3.8/site-packages/pandas/tests/plotting/test_frame.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | env/lib/python3.8/site-packages/pandas/tests/plotting/test_frame.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | env/lib/python3.8/site-packages/pandas/tests/plotting/test_frame.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | # coding: utf-8
""" Test cases for DataFrame.plot """
from datetime import date, datetime
import itertools
import string
import warnings
import numpy as np
from numpy.random import rand, randn
import pytest
import pandas.util._test_decorators as td
from pandas.core.dtypes.api import is_list_like
import pandas as ... | 38.835897 | 88 | 0.567108 |
from datetime import date, datetime
import itertools
import string
import warnings
import numpy as np
from numpy.random import rand, randn
import pytest
import pandas.util._test_decorators as td
from pandas.core.dtypes.api import is_list_like
import pandas as pd
from pandas import DataFrame, MultiIndex, PeriodIn... | true | true |
1c429be3e6cc511b6861bec09506e19de1a9abb1 | 2,808 | py | Python | reinforcement/bpsm.py | jguilhermeam/cnn-iets | 0636fc8803ec46a1874a7c6dda6590cd9d7a7c53 | [
"MIT"
] | null | null | null | reinforcement/bpsm.py | jguilhermeam/cnn-iets | 0636fc8803ec46a1874a7c6dda6590cd9d7a7c53 | [
"MIT"
] | null | null | null | reinforcement/bpsm.py | jguilhermeam/cnn-iets | 0636fc8803ec46a1874a7c6dda6590cd9d7a7c53 | [
"MIT"
] | null | null | null | class BPSM:
def __init__(self, records, attribute_list):
print("Calculating BPSM matrices...")
attribute_list.extend(['begin','end'])
self.f_matrix = self.init_f_matrix(records, attribute_list)
self.b_matrix = self.init_b_matrix(records, attribute_list)
attribute_list.remov... | 32.275862 | 67 | 0.48433 | class BPSM:
def __init__(self, records, attribute_list):
print("Calculating BPSM matrices...")
attribute_list.extend(['begin','end'])
self.f_matrix = self.init_f_matrix(records, attribute_list)
self.b_matrix = self.init_b_matrix(records, attribute_list)
attribute_list.remov... | true | true |
1c429cf406f178da536dd142c086cf9ce74ebae9 | 2,840 | py | Python | args/regex/test_args.py | smalepati99/pytest-bdd-python | 6fd5b09452403cdd8373c5aea623cc5be1e627ba | [
"Apache-2.0"
] | 944 | 2015-02-28T20:13:01.000Z | 2022-03-29T16:04:58.000Z | args/regex/test_args.py | smalepati99/pytest-bdd-python | 6fd5b09452403cdd8373c5aea623cc5be1e627ba | [
"Apache-2.0"
] | 393 | 2015-03-02T21:01:12.000Z | 2022-03-30T13:04:04.000Z | args/regex/test_args.py | smalepati99/pytest-bdd-python | 6fd5b09452403cdd8373c5aea623cc5be1e627ba | [
"Apache-2.0"
] | 178 | 2015-03-12T21:46:51.000Z | 2022-03-24T11:46:15.000Z | """Step arguments tests."""
import textwrap
def test_every_steps_takes_param_with_the_same_name(testdir):
testdir.makefile(
".feature",
arguments=textwrap.dedent(
"""\
Feature: Step arguments
Scenario: Every step takes a parameter with the same name
... | 26.542056 | 89 | 0.534507 |
import textwrap
def test_every_steps_takes_param_with_the_same_name(testdir):
testdir.makefile(
".feature",
arguments=textwrap.dedent(
"""\
Feature: Step arguments
Scenario: Every step takes a parameter with the same name
Given I have 1 ... | true | true |
1c429d734bcad3299699b458f7a0c48c61376d31 | 259 | py | Python | config.py | lightning-sprinkle/lightning-sprinkle-service | c5f44d17da2a9894982e203aa1fbcc6f74753db2 | [
"MIT"
] | null | null | null | config.py | lightning-sprinkle/lightning-sprinkle-service | c5f44d17da2a9894982e203aa1fbcc6f74753db2 | [
"MIT"
] | null | null | null | config.py | lightning-sprinkle/lightning-sprinkle-service | c5f44d17da2a9894982e203aa1fbcc6f74753db2 | [
"MIT"
] | null | null | null |
"""
Application configuration
"""
# The maximum reward per hour in satoshis
max_hourly_reward = 40
# Only reward hostnams with a valid OV or EV certificate.
organization_only = False
# Hostnames that will never get a reward
blacklist = [
'example.com'
] | 17.266667 | 57 | 0.749035 |
max_hourly_reward = 40
organization_only = False
blacklist = [
'example.com'
] | true | true |
1c429d8117c4a9648bd684460e211b645d1066da | 159 | py | Python | derivative.py | daviddamilola/python-initial-gra-gra | 9978bfda18f12c87601b110f297da2cb13872d27 | [
"MIT"
] | 1 | 2019-11-07T21:30:21.000Z | 2019-11-07T21:30:21.000Z | derivative.py | daviddamilola/python-initial-gra-gra | 9978bfda18f12c87601b110f297da2cb13872d27 | [
"MIT"
] | 2 | 2021-04-06T18:19:09.000Z | 2021-06-02T03:27:18.000Z | derivative.py | daviddamilola/python-initial-gra-gra | 9978bfda18f12c87601b110f297da2cb13872d27 | [
"MIT"
] | null | null | null | """
formula for the derivative of a function
f′(a) = lim f(a+h)− f(a) / h
h→0
"""
def derivative(f, h):
return lambda x: (f(x + h) - f(x)) / h
| 14.454545 | 42 | 0.509434 |
def derivative(f, h):
return lambda x: (f(x + h) - f(x)) / h
| true | true |
1c429d9483d7d7d6d3108e553c8492771ee15b86 | 794 | py | Python | showings/migrations/0010_auto_20170925_2310.py | WarwickAnimeSoc/aniMango | f927c2bc6eb484561ab38172ebebee6f03c8b13b | [
"MIT"
] | null | null | null | showings/migrations/0010_auto_20170925_2310.py | WarwickAnimeSoc/aniMango | f927c2bc6eb484561ab38172ebebee6f03c8b13b | [
"MIT"
] | 6 | 2016-10-18T14:52:05.000Z | 2020-06-18T15:14:41.000Z | showings/migrations/0010_auto_20170925_2310.py | WarwickAnimeSoc/aniMango | f927c2bc6eb484561ab38172ebebee6f03c8b13b | [
"MIT"
] | 6 | 2020-02-07T17:37:37.000Z | 2021-01-15T00:01:43.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-25 22:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('showings', '0009_auto_20170925_2248'),
]
operations = [
migrations.AddField... | 30.538462 | 164 | 0.605793 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('showings', '0009_auto_20170925_2248'),
]
operations = [
migrations.AddField(
model_name='showing',
name='details',
... | true | true |
1c429dfb608ea989b584076ad999a25015057fb7 | 4,234 | py | Python | CSV2SHP/AddMinutes.py | bryansandw/Rain_Gauges | 936f3b5c8e1274a1f9dc3150c5b268d30f5cadf9 | [
"MIT"
] | null | null | null | CSV2SHP/AddMinutes.py | bryansandw/Rain_Gauges | 936f3b5c8e1274a1f9dc3150c5b268d30f5cadf9 | [
"MIT"
] | null | null | null | CSV2SHP/AddMinutes.py | bryansandw/Rain_Gauges | 936f3b5c8e1274a1f9dc3150c5b268d30f5cadf9 | [
"MIT"
] | 3 | 2015-12-17T15:20:07.000Z | 2020-01-09T17:57:23.000Z | #############################################################################
# Name: Elizabeth Rentschlar #
# Assistantce from: S. Boada #
# Purpose: add new data to the existing Minute_Rainfall_Events.txt doc #
# Create... | 38.490909 | 373 | 0.513935 | false | true | |
1c42a08940e444dd3ecf4c062516205b6371119e | 2,259 | py | Python | tests/test-version.py | Jastor11/aiobotocore | 40427e6c45dd6b8fb75072f13cfb076cf6c4d10b | [
"Apache-2.0"
] | 772 | 2016-02-12T13:20:26.000Z | 2022-03-29T20:51:37.000Z | tests/test-version.py | Jastor11/aiobotocore | 40427e6c45dd6b8fb75072f13cfb076cf6c4d10b | [
"Apache-2.0"
] | 826 | 2016-02-14T11:31:25.000Z | 2022-03-31T20:41:31.000Z | tests/test-version.py | Jastor11/aiobotocore | 40427e6c45dd6b8fb75072f13cfb076cf6c4d10b | [
"Apache-2.0"
] | 154 | 2016-04-28T16:27:33.000Z | 2022-03-05T19:41:52.000Z | import pytest
import docutils.nodes
import docutils.parsers.rst
import docutils.utils
import docutils.frontend
import aiobotocore
import re
from pathlib import Path
from packaging import version
from datetime import datetime
# from: https://stackoverflow.com/a/48719723/1241593
def _parse_rst(text: str) -> docutils.no... | 33.220588 | 85 | 0.709606 | import pytest
import docutils.nodes
import docutils.parsers.rst
import docutils.utils
import docutils.frontend
import aiobotocore
import re
from pathlib import Path
from packaging import version
from datetime import datetime
def _parse_rst(text: str) -> docutils.nodes.document:
parser = docutils.parsers.rst.Pars... | true | true |
1c42a1324b17e0befbcd29042fc01f59088beaec | 463 | py | Python | OsterAnmeldung/models.py | Husterknupp/2020-oster-squash | 43e8742c89ad1225119e8d2c4d2dba6a2914dd0d | [
"MIT"
] | 1 | 2020-03-06T16:06:00.000Z | 2020-03-06T16:06:00.000Z | OsterAnmeldung/models.py | Husterknupp/2020-oster-squash | 43e8742c89ad1225119e8d2c4d2dba6a2914dd0d | [
"MIT"
] | 1 | 2021-06-10T18:36:46.000Z | 2021-06-10T18:36:46.000Z | OsterAnmeldung/models.py | Husterknupp/2020-oster-squash | 43e8742c89ad1225119e8d2c4d2dba6a2914dd0d | [
"MIT"
] | 1 | 2020-03-05T23:38:21.000Z | 2020-03-05T23:38:21.000Z | from django.db import models
class Registration(models.Model):
id = models.CharField(primary_key=True, unique=True, max_length=120)
emailAddress = models.TextField()
timeFrameBegin = models.DateTimeField()
dateOfRegistration = models.DateTimeField(auto_now=True)
quantity = models.IntegerField()
... | 33.071429 | 77 | 0.719222 | from django.db import models
class Registration(models.Model):
id = models.CharField(primary_key=True, unique=True, max_length=120)
emailAddress = models.TextField()
timeFrameBegin = models.DateTimeField()
dateOfRegistration = models.DateTimeField(auto_now=True)
quantity = models.IntegerField()
... | true | true |
1c42a1771f2e1ab5a3930a8db384eefefe3ac7f5 | 4,336 | py | Python | examples/collectors/interval_collectors.py | benji011/instascrape | 712a7b0e2b5abd635d0113b5600e8cb62d6bdbbc | [
"MIT"
] | null | null | null | examples/collectors/interval_collectors.py | benji011/instascrape | 712a7b0e2b5abd635d0113b5600e8cb62d6bdbbc | [
"MIT"
] | null | null | null | examples/collectors/interval_collectors.py | benji011/instascrape | 712a7b0e2b5abd635d0113b5600e8cb62d6bdbbc | [
"MIT"
] | null | null | null | import datetime
from itertools import cycle
import time
from typing import List, Callable
class IntervalCollector:
"""
Given a list of scraper objects, perform different data collection tasks
"""
def __init__(self, scrapers: List["Scrapers"]) -> None:
if not type(scrapers) == li... | 32.358209 | 121 | 0.562269 | import datetime
from itertools import cycle
import time
from typing import List, Callable
class IntervalCollector:
def __init__(self, scrapers: List["Scrapers"]) -> None:
if not type(scrapers) == list:
scrapers = list(scrapers)
self.scrapers = scrapers
def _calcula... | true | true |
1c42a1af5d59125195c23ba20d51a39b303f93cd | 6,166 | py | Python | src/models/legendre_duality/train.py | lavoiems/NeuralWassersteinFlow | b120778d75fc7afc9b6a56724768ab39ad7c0b91 | [
"MIT"
] | null | null | null | src/models/legendre_duality/train.py | lavoiems/NeuralWassersteinFlow | b120778d75fc7afc9b6a56724768ab39ad7c0b91 | [
"MIT"
] | null | null | null | src/models/legendre_duality/train.py | lavoiems/NeuralWassersteinFlow | b120778d75fc7afc9b6a56724768ab39ad7c0b91 | [
"MIT"
] | null | null | null | import time
import torch
from torch import optim
from sklearn.decomposition import PCA
import matplotlib.pylab as plt
import torch.nn.functional as F
from common.util import sample, save_models
from common.initialize import initialize, infer_iteration
from . import model
def c_transform(y, ey, lp, critic):
cy = ... | 36.702381 | 111 | 0.628608 | import time
import torch
from torch import optim
from sklearn.decomposition import PCA
import matplotlib.pylab as plt
import torch.nn.functional as F
from common.util import sample, save_models
from common.initialize import initialize, infer_iteration
from . import model
def c_transform(y, ey, lp, critic):
cy = ... | true | true |
1c42a3d855bc16c21e385d7108c3106884ae4f5e | 27,746 | py | Python | tensorflow/contrib/data/python/kernel_tests/reader_dataset_ops_test.py | harunpehlivan/tensorflow | 376e2cfdab31f4da251ea2e50992a9bf97fd171b | [
"Apache-2.0"
] | 24 | 2018-02-01T15:49:22.000Z | 2021-01-11T16:31:18.000Z | tensorflow/contrib/data/python/kernel_tests/reader_dataset_ops_test.py | hamzabekkouri/tensorflow | d87a9fbbc5f49ec5ae8eb52c62628f0b1a0bf67f | [
"Apache-2.0"
] | 3 | 2018-05-09T11:31:58.000Z | 2021-01-27T12:26:21.000Z | tensorflow/contrib/data/python/kernel_tests/reader_dataset_ops_test.py | hamzabekkouri/tensorflow | d87a9fbbc5f49ec5ae8eb52c62628f0b1a0bf67f | [
"Apache-2.0"
] | 13 | 2018-02-22T21:04:13.000Z | 2020-11-17T11:38:36.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.393531 | 87 | 0.653932 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import zlib
from tensorflow.contrib.data.python.kernel_tests import dataset_serialization_test_base
from tensorflow.contrib.data.python.ops import readers
from tensorflow.co... | true | true |
1c42a45984700520b74c50a6c75286ee65c109e9 | 305 | py | Python | Dataset/Leetcode/train/111/532.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/111/532.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/111/532.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
def XXX(self, root: TreeNode) -> int:
if not root:
return 0
def fun(node):
if not node: return 0x3f3f3f
if not node.left and not node.right: return 1
return min(fun(node.left),fun(node.right))+1
return fun(root)
| 27.727273 | 57 | 0.55082 | class Solution:
def XXX(self, root: TreeNode) -> int:
if not root:
return 0
def fun(node):
if not node: return 0x3f3f3f
if not node.left and not node.right: return 1
return min(fun(node.left),fun(node.right))+1
return fun(root)
| true | true |
1c42a4d54ab1ec0325767e0a5c09c49005819c3d | 3,391 | py | Python | data/p2DJ/New/program/qiskit/simulator/startQiskit365.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/simulator/startQiskit365.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p2DJ/New/program/qiskit/simulator/startQiskit365.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=21
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy a... | 29.232759 | 82 | 0.627543 |
import cirq
import qiskit
from qiskit import IBMQ
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as nx
def b... | true | true |
1c42a56f7472dd88036f3b89d2f4f2d610f06ef4 | 7,566 | py | Python | neobolt/packstream/unpacker.py | technige/neobolt | f48eac3046cf0f6d6fe534fdb53ea42c964bcc9f | [
"Apache-2.0"
] | null | null | null | neobolt/packstream/unpacker.py | technige/neobolt | f48eac3046cf0f6d6fe534fdb53ea42c964bcc9f | [
"Apache-2.0"
] | null | null | null | neobolt/packstream/unpacker.py | technige/neobolt | f48eac3046cf0f6d6fe534fdb53ea42c964bcc9f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2018 "Neo4j,"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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 L... | 32.333333 | 80 | 0.52313 |
from codecs import decode
from struct import unpack as struct_unpack
from neobolt.packstream import Structure
EndOfStream = object()
class Unpacker(object):
def __init__(self):
self.source = None
def attach(self, source):
self.source = source
def read(self, n=1):... | true | true |
1c42a692e9ca72a0c30ddf8303060417384e81f4 | 1,477 | py | Python | final_project/machinetranslation/translator.py | INKI-LEE/xzceb-flask_eng_fr | 956eb3e412300e48d9cda44ab26c95dfd60f572b | [
"Apache-2.0"
] | null | null | null | final_project/machinetranslation/translator.py | INKI-LEE/xzceb-flask_eng_fr | 956eb3e412300e48d9cda44ab26c95dfd60f572b | [
"Apache-2.0"
] | null | null | null | final_project/machinetranslation/translator.py | INKI-LEE/xzceb-flask_eng_fr | 956eb3e412300e48d9cda44ab26c95dfd60f572b | [
"Apache-2.0"
] | null | null | null | """ Translator Function that englishToFrench , frenchToEnglish """
#import json
import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
load_dotenv()
apikey = os.environ['apikey']
url = os.environ['url']
authenticator = IAMAu... | 30.770833 | 96 | 0.748815 |
import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
load_dotenv()
apikey = os.environ['apikey']
url = os.environ['url']
authenticator = IAMAuthenticator(apikey)
language_translator = LanguageTranslatorV3(
version='20... | true | true |
1c42a777c6de08f275682745b20477927936713a | 25,327 | py | Python | src/sentry/web/api.py | nuklea/sentry | 9d5c0a9c1899a651dad830a9e881ea2a63577c7d | [
"BSD-3-Clause"
] | null | null | null | src/sentry/web/api.py | nuklea/sentry | 9d5c0a9c1899a651dad830a9e881ea2a63577c7d | [
"BSD-3-Clause"
] | null | null | null | src/sentry/web/api.py | nuklea/sentry | 9d5c0a9c1899a651dad830a9e881ea2a63577c7d | [
"BSD-3-Clause"
] | null | null | null | """
sentry.web.views
~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import datetime
import logging
from functools import wraps
from django.contrib import messages
from django.contrib.auth.models import AnonymousUser
from dj... | 30.588164 | 122 | 0.655664 | """
sentry.web.views
~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import datetime
import logging
from functools import wraps
from django.contrib import messages
from django.contrib.auth.models import AnonymousUser
from dj... | false | true |
1c42a7bb962587e69a70ca8c8836c686c53ab380 | 4,220 | py | Python | FWCore/Integration/test/readSubProcessOutput_cfg.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | FWCore/Integration/test/readSubProcessOutput_cfg.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | FWCore/Integration/test/readSubProcessOutput_cfg.py | nistefan/cmssw | ea13af97f7f2117a4f590a5e654e06ecd9825a5b | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
process = cms.Process("READ")
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring("file:testSubProcess.root")
)
process.out = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string(
'readSubprocessOutput.root'
)
)
# Re... | 25.421687 | 68 | 0.502133 | import FWCore.ParameterSet.Config as cms
process = cms.Process("READ")
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring("file:testSubProcess.root")
)
process.out = cms.OutputModule("PoolOutputModule",
fileName = cms.untracked.string(
'readSubprocessOutput.root'
)
)
... | true | true |
1c42a87c9ff7574326b25e2c3e6cf0edcb5bef4e | 9,980 | py | Python | paddlespeech/t2s/exps/synthesize.py | phecda-xu/PaddleSpeech | 6bf0d3bf57229091a74912633e837dabc6215c86 | [
"Apache-2.0"
] | 1 | 2022-02-26T01:48:00.000Z | 2022-02-26T01:48:00.000Z | paddlespeech/t2s/exps/synthesize.py | phecda-xu/PaddleSpeech | 6bf0d3bf57229091a74912633e837dabc6215c86 | [
"Apache-2.0"
] | null | null | null | paddlespeech/t2s/exps/synthesize.py | phecda-xu/PaddleSpeech | 6bf0d3bf57229091a74912633e837dabc6215c86 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 34.895105 | 102 | 0.63517 |
import argparse
import logging
from pathlib import Path
import jsonlines
import numpy as np
import paddle
import soundfile as sf
import yaml
from yacs.config import CfgNode
from paddlespeech.s2t.utils.dynamic_import import dynamic_import
from paddlespeech.t2s.datasets.data_table import DataTable
from pad... | true | true |
1c42a96d611af83e23e1b80282feb7f487a972f8 | 9,681 | py | Python | lib/python2.7/site-packages/networkx/algorithms/coloring/greedy_coloring.py | nishaero/wifi-userseg-ryu | 1132f2c813b79eff755bdd1a9e73e7ad3980af7c | [
"Apache-2.0"
] | 15 | 2018-04-26T08:17:18.000Z | 2021-03-05T08:44:13.000Z | lib/python2.7/site-packages/networkx/algorithms/coloring/greedy_coloring.py | nishaero/wifi-userseg-ryu | 1132f2c813b79eff755bdd1a9e73e7ad3980af7c | [
"Apache-2.0"
] | null | null | null | lib/python2.7/site-packages/networkx/algorithms/coloring/greedy_coloring.py | nishaero/wifi-userseg-ryu | 1132f2c813b79eff755bdd1a9e73e7ad3980af7c | [
"Apache-2.0"
] | 6 | 2018-04-12T15:49:27.000Z | 2022-01-27T12:34:50.000Z | # -*- coding: utf-8 -*-
"""
Greedy graph coloring using various strategies.
"""
# Copyright (C) 2014 by
# Christian Olsson <chro@itu.dk>
# Jan Aagaard Meier <jmei@itu.dk>
# Henrik Haugbølle <hhau@itu.dk>
# All rights reserved.
# BSD license.
import networkx as nx
import random
import itertools
from . ... | 32.816949 | 84 | 0.624729 |
import networkx as nx
import random
import itertools
from . import greedy_coloring_with_interchange as _interchange
__author__ = "\n".join(["Christian Olsson <chro@itu.dk>",
"Jan Aagaard Meier <jmei@itu.dk>",
"Henrik Haugbølle <hhau@itu.dk>"])
__all__ = [
'gre... | true | true |
1c42aa4b0857b199c7a25f26b3a6ff5382190116 | 1,728 | py | Python | appengine/standard_python3/building-an-app/building-an-app-1/main.py | yshalabi/python-docs-samples | 591787c01d94102ba9205f998d95a05b39ccad2f | [
"Apache-2.0"
] | 2 | 2020-09-19T04:22:52.000Z | 2020-09-23T14:04:17.000Z | appengine/standard_python3/building-an-app/building-an-app-1/main.py | yshalabi/python-docs-samples | 591787c01d94102ba9205f998d95a05b39ccad2f | [
"Apache-2.0"
] | 28 | 2020-08-20T21:36:30.000Z | 2021-06-21T18:05:17.000Z | appengine/standard_python3/building-an-app/building-an-app-1/main.py | yshalabi/python-docs-samples | 591787c01d94102ba9205f998d95a05b39ccad2f | [
"Apache-2.0"
] | 2 | 2020-09-13T03:47:22.000Z | 2020-09-23T14:04:19.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 38.4 | 78 | 0.707755 |
import datetime
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def root():
dummy_times = [datetime.datetime(2018, 1, 1, 10, 0, 0),
datetime.datetime(2018, 1, 2, 10, 30, 0),
datetime.datetime(2018, 1, 3, 11, 0, 0),
... | true | true |
1c42ae3e0fab02a746f010480f8226dcab3ecade | 1,942 | py | Python | price/coinmarketcap.py | victoray/block-tracker-api | 0d5918a29572b47b0fb3f205fc1ba21ad4fcca51 | [
"MIT"
] | null | null | null | price/coinmarketcap.py | victoray/block-tracker-api | 0d5918a29572b47b0fb3f205fc1ba21ad4fcca51 | [
"MIT"
] | null | null | null | price/coinmarketcap.py | victoray/block-tracker-api | 0d5918a29572b47b0fb3f205fc1ba21ad4fcca51 | [
"MIT"
] | null | null | null | import json
import logging
from typing import Dict
import pydash
from fastapi import HTTPException
from requests import Session
from requests.exceptions import ConnectionError, Timeout, TooManyRedirects
from price import settings
from price.models import Price
# FIAT
from price.redis_utils import redis_client
NGN_I... | 25.893333 | 79 | 0.661174 | import json
import logging
from typing import Dict
import pydash
from fastapi import HTTPException
from requests import Session
from requests.exceptions import ConnectionError, Timeout, TooManyRedirects
from price import settings
from price.models import Price
from price.redis_utils import redis_client
NGN_ID = "2... | true | true |
1c42b0c83dde5f21f9c07838ae65e0ccb09e3d2a | 849 | py | Python | docs/src/classification6.py | vishalbelsare/RLScore | 713f0a402f7a09e41a609f2ddcaf849b2021a0a7 | [
"MIT"
] | 61 | 2015-03-06T08:48:01.000Z | 2021-04-26T16:13:07.000Z | docs/src/classification6.py | andrecamara/RLScore | 713f0a402f7a09e41a609f2ddcaf849b2021a0a7 | [
"MIT"
] | 5 | 2016-09-08T15:47:00.000Z | 2019-02-25T17:44:55.000Z | docs/src/classification6.py | vishalbelsare/RLScore | 713f0a402f7a09e41a609f2ddcaf849b2021a0a7 | [
"MIT"
] | 31 | 2015-01-28T15:05:33.000Z | 2021-04-16T19:39:48.000Z | from rlscore.learner import LeaveOneOutRLS
from rlscore.measure import ova_accuracy
from wine_data import load_wine
from rlscore.utilities.multiclass import to_one_vs_all
def train_rls():
X_train, Y_train, X_test, Y_test = load_wine()
#Map labels from set {1,2,3} to one-vs-all encoding
Y_train = to_one_vs_... | 42.45 | 94 | 0.756184 | from rlscore.learner import LeaveOneOutRLS
from rlscore.measure import ova_accuracy
from wine_data import load_wine
from rlscore.utilities.multiclass import to_one_vs_all
def train_rls():
X_train, Y_train, X_test, Y_test = load_wine()
Y_train = to_one_vs_all(Y_train, False)
Y_test = to_one_vs_all(Y_te... | true | true |
1c42b3086097a4aaa38d65dc07b57a7f3a4d5b17 | 10,360 | py | Python | tests/gold_tests/pluginTest/slice/slice_error.test.py | zhaorun/trafficserver | 757256129811441f29eea288b1d7e19bc54fab9c | [
"Apache-2.0"
] | null | null | null | tests/gold_tests/pluginTest/slice/slice_error.test.py | zhaorun/trafficserver | 757256129811441f29eea288b1d7e19bc54fab9c | [
"Apache-2.0"
] | 3 | 2017-09-22T19:18:56.000Z | 2021-06-21T18:07:14.000Z | tests/gold_tests/pluginTest/slice/slice_error.test.py | zhaorun/trafficserver | 757256129811441f29eea288b1d7e19bc54fab9c | [
"Apache-2.0"
] | null | null | null | '''
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License");... | 31.876923 | 136 | 0.699131 |
import os
import time
Test.Summary = '''
Slice plugin error.log test
'''
s(
Condition.PluginExists('slice.so'),
)
Test.ContinueOnFail = False
server = Test.MakeOriginServer("server", lookup_key="{%Range}{PATH}")
ts = Test.MakeATSProcess("ts", command="traffic_manager", select_ports=True)
body ... | true | true |
1c42b490ea7b27440738e2963c5613c34487593a | 8,334 | py | Python | tools/validators/instance_validator/validate/handler.py | ljulliar/digitalbuildings | 5b5be8db9e00d967911065f5247a8d39512e6504 | [
"Apache-2.0"
] | null | null | null | tools/validators/instance_validator/validate/handler.py | ljulliar/digitalbuildings | 5b5be8db9e00d967911065f5247a8d39512e6504 | [
"Apache-2.0"
] | null | null | null | tools/validators/instance_validator/validate/handler.py | ljulliar/digitalbuildings | 5b5be8db9e00d967911065f5247a8d39512e6504 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | 35.46383 | 80 | 0.705064 |
from __future__ import print_function
from datetime import datetime
import sys
from typing import Callable, Dict, List, Optional
from validate import entity_instance
from validate import generate_universe
from validate import instance_parser
from validate import subscriber
from validate import telemetry... | true | true |
1c42b4bb2d2af7735cddc76247f942db7850523b | 1,417 | py | Python | mindspore/ops/_op_impl/tbe/add_n.py | GuoSuiming/mindspore | 48afc4cfa53d970c0b20eedfb46e039db2a133d5 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | mindspore/ops/_op_impl/tbe/add_n.py | forwhat461/mindspore | 59a277756eb4faad9ac9afcc7fd526e8277d4994 | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | mindspore/ops/_op_impl/tbe/add_n.py | forwhat461/mindspore | 59a277756eb4faad9ac9afcc7fd526e8277d4994 | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 35.425 | 79 | 0.664785 |
from mindspore.ops.op_info_register import op_info_register, TBERegOp, DataType
add_n_op_info = TBERegOp("AddN") \
.fusion_type("ELEMWISE") \
.async_flag(False) \
.binfile_name("add_n.so") \
.compute_cost(10) \
.kernel_name("add_n") \
.partial_flag(True) \
.attr("n", "require... | true | true |
1c42b4d53e445692e9aafb1231685cc33fdca33e | 29,557 | py | Python | assignment_1/pos_hmm_bigram.py | sigfredonin/NEU_CS6120 | 878fb65f9685af8f4d464398f26d1c5e1a803971 | [
"FSFAP"
] | null | null | null | assignment_1/pos_hmm_bigram.py | sigfredonin/NEU_CS6120 | 878fb65f9685af8f4d464398f26d1c5e1a803971 | [
"FSFAP"
] | null | null | null | assignment_1/pos_hmm_bigram.py | sigfredonin/NEU_CS6120 | 878fb65f9685af8f4d464398f26d1c5e1a803971 | [
"FSFAP"
] | null | null | null | """
NEU CS6120 Assignment 1
Problem 4 POS Tagging - Hidden Markov Model
The training set is a collection of files from the Brown corpus.
The training set files have sentences of tokenized tagged words,
w_1/t_1 w_2/t_2 w_3/t_3 ... w_k-1/t_k-1 w_k/t_k
one sentence per line, with leading white space.
Some lines are e... | 43.983631 | 98 | 0.573908 | import nltk
import numpy as np
import os
import re
from collections import defaultdict
TOK_SS = '<s>'
TAG_SS = '$S'
TOK_ES = '</s>'
TAG_ES = 'S$'
pathToyPOS = r'D:/Documents/NLP/NEU_CS6120/assignment_1/toyPOS'
pathBrownData = r'D:/Documents/NLP/NEU_CS6120/assignment_1/brown'
pathTestDataFile = r'D:/Documents/NL... | true | true |
1c42b4fe252a2b8d7e32eecf685d315cd9c26d3f | 7,458 | py | Python | api/src/shallowflow/api/storage.py | waikato-datamining/shallow-flow | 3f1d99921e5138598eb164edeb1d23e6f199501c | [
"MIT"
] | null | null | null | api/src/shallowflow/api/storage.py | waikato-datamining/shallow-flow | 3f1d99921e5138598eb164edeb1d23e6f199501c | [
"MIT"
] | 2 | 2021-08-18T22:00:08.000Z | 2021-08-18T22:00:47.000Z | api/src/shallowflow/api/storage.py | waikato-datamining/shallowflow | 3f1d99921e5138598eb164edeb1d23e6f199501c | [
"MIT"
] | null | null | null | from .serialization.vars import AbstractStringReader, add_string_reader
STORAGE_EVENT_ADDED = "added"
STORAGE_EVENT_UPDATED = "updated"
STORAGE_EVENT_DELETED = "deleted"
STORAGE_EVENT_CLEARED = "cleared"
STORAGE_EVENTS = [
STORAGE_EVENT_ADDED,
STORAGE_EVENT_UPDATED,
STORAGE_EVENT_DELETED,
STORAGE_EVE... | 24.135922 | 88 | 0.581121 | from .serialization.vars import AbstractStringReader, add_string_reader
STORAGE_EVENT_ADDED = "added"
STORAGE_EVENT_UPDATED = "updated"
STORAGE_EVENT_DELETED = "deleted"
STORAGE_EVENT_CLEARED = "cleared"
STORAGE_EVENTS = [
STORAGE_EVENT_ADDED,
STORAGE_EVENT_UPDATED,
STORAGE_EVENT_DELETED,
STORAGE_EVE... | true | true |
1c42b50300a237606c6e96e351bb8643bd3bedc4 | 315 | py | Python | Learning/Test16_KeywordArguments.py | liang1024/Python | a80127500f7a171567e32699f42128f3ddc44b3f | [
"Apache-2.0"
] | 1 | 2017-03-07T13:49:27.000Z | 2017-03-07T13:49:27.000Z | Learning/Test16_KeywordArguments.py | liang1024/Python | a80127500f7a171567e32699f42128f3ddc44b3f | [
"Apache-2.0"
] | null | null | null | Learning/Test16_KeywordArguments.py | liang1024/Python | a80127500f7a171567e32699f42128f3ddc44b3f | [
"Apache-2.0"
] | null | null | null | '''
Keyword Arguments :参数
'''
def dumb_sentence(name='Bucky', action='ate', item='tuna'):
print(name, action, item)
dumb_sentence()
dumb_sentence("Sally", "farts", "gently")
# 给固定的参数赋值
dumb_sentence(item="awesome")
dumb_sentence(item="awesome", action="is")
dumb_sentence("哈哈")
dumb_sentence("", "", "哈哈")
| 17.5 | 59 | 0.68254 |
def dumb_sentence(name='Bucky', action='ate', item='tuna'):
print(name, action, item)
dumb_sentence()
dumb_sentence("Sally", "farts", "gently")
dumb_sentence(item="awesome")
dumb_sentence(item="awesome", action="is")
dumb_sentence("哈哈")
dumb_sentence("", "", "哈哈")
| true | true |
1c42b6cacbed951c3e9b79ad8a47fceae615b25a | 1,252 | py | Python | ict/Interface.py | sclel016/ict_py | a5333b4a2a882ea64ae88825118e0ab0cc734b67 | [
"MIT"
] | null | null | null | ict/Interface.py | sclel016/ict_py | a5333b4a2a882ea64ae88825118e0ab0cc734b67 | [
"MIT"
] | null | null | null | ict/Interface.py | sclel016/ict_py | a5333b4a2a882ea64ae88825118e0ab0cc734b67 | [
"MIT"
] | null | null | null | import pyvisa
import re
class Interface:
inst = ''
ip = ''
ident = ''
rm = pyvisa.ResourceManager()
def __init__(self,ip):
self.ip = ip
self.inst = self.rm.open_resource('TCPIP0::%s::INSTR' % self.ip)
self.ident = self.inst.query("*IDN?")
def query(self,cmd):
... | 23.185185 | 72 | 0.610224 | import pyvisa
import re
class Interface:
inst = ''
ip = ''
ident = ''
rm = pyvisa.ResourceManager()
def __init__(self,ip):
self.ip = ip
self.inst = self.rm.open_resource('TCPIP0::%s::INSTR' % self.ip)
self.ident = self.inst.query("*IDN?")
def query(self,cmd):
... | true | true |
1c42b7c5508775b934a83eceaf7f1a2496db8071 | 1,379 | py | Python | xlsxwriter/test/comparison/test_chart_axis05.py | eddiechapman/XlsxWriter | c636117ab30e64e4b7b824c9105595c42887c2c9 | [
"BSD-2-Clause-FreeBSD"
] | 2,766 | 2015-01-02T17:36:42.000Z | 2022-03-31T09:23:30.000Z | xlsxwriter/test/comparison/test_chart_axis05.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | 683 | 2015-01-03T09:55:02.000Z | 2022-03-31T07:18:15.000Z | xlsxwriter/test/comparison/test_chart_axis05.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | 636 | 2015-01-05T01:57:08.000Z | 2022-03-25T18:42:41.000Z | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 25.072727 | 79 | 0.5562 | true | true | |
1c42b93d37509c48c79daf914533bda3f3c15331 | 1,771 | py | Python | galaxy/python/GalaxySpectrumVIPERS.py | AndresSixtos/pyeBOSS | 4750908c8bc409633bef8f790133e3a1f3f0c9e4 | [
"CC0-1.0"
] | 1 | 2017-05-23T13:03:27.000Z | 2017-05-23T13:03:27.000Z | galaxy/python/GalaxySpectrumVIPERS.py | AndresSixtos/pyeBOSS | 4750908c8bc409633bef8f790133e3a1f3f0c9e4 | [
"CC0-1.0"
] | null | null | null | galaxy/python/GalaxySpectrumVIPERS.py | AndresSixtos/pyeBOSS | 4750908c8bc409633bef8f790133e3a1f3f0c9e4 | [
"CC0-1.0"
] | 2 | 2017-09-26T11:17:30.000Z | 2021-09-14T06:09:18.000Z | """
.. class:: GalaxySpectrumVIPERS
.. moduleauthor:: Johan Comparat <johan.comparat__at__gmail.com>
The class GalaxySpectrumVIPERS is dedicated to handling VIPERS spectra
"""
from os.path import join
import os
import numpy as n
import astropy.io.fits as fits
import glob
class GalaxySpectrumVIPERS:
"""
... | 34.72549 | 164 | 0.728967 | """
.. class:: GalaxySpectrumVIPERS
.. moduleauthor:: Johan Comparat <johan.comparat__at__gmail.com>
The class GalaxySpectrumVIPERS is dedicated to handling VIPERS spectra
"""
from os.path import join
import os
import numpy as n
import astropy.io.fits as fits
import glob
class GalaxySpectrumVIPERS:
"""
... | false | true |
1c42b967ac3297973c93f17f3c6acb4ba1b51b04 | 3,975 | py | Python | metricbeat/tests/system/test_base.py | kemokemo/beats | dda9f353f1203da243bd76baf53d2e83b6f26c1a | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2020-11-17T06:29:30.000Z | 2021-08-08T11:56:01.000Z | metricbeat/tests/system/test_base.py | kemokemo/beats | dda9f353f1203da243bd76baf53d2e83b6f26c1a | [
"ECL-2.0",
"Apache-2.0"
] | 36 | 2021-02-02T14:18:40.000Z | 2022-03-20T15:07:30.000Z | metricbeat/tests/system/test_base.py | kemokemo/beats | dda9f353f1203da243bd76baf53d2e83b6f26c1a | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2021-03-10T05:38:32.000Z | 2021-08-16T13:11:19.000Z | import os
import pytest
import re
import shutil
import sys
import unittest
from metricbeat import BaseTest
from beat.beat import INTEGRATION_TESTS
from beat import common_tests
from elasticsearch import Elasticsearch
class Test(BaseTest, common_tests.TestExportsMixin):
COMPOSE_SERVICES = ['elasticsearch', 'kib... | 34.565217 | 124 | 0.597484 | import os
import pytest
import re
import shutil
import sys
import unittest
from metricbeat import BaseTest
from beat.beat import INTEGRATION_TESTS
from beat import common_tests
from elasticsearch import Elasticsearch
class Test(BaseTest, common_tests.TestExportsMixin):
COMPOSE_SERVICES = ['elasticsearch', 'kib... | true | true |
1c42b9f7576667b34b41fe63bc2f0dbe7a514dda | 60,347 | py | Python | vivarium/core/experiment.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | vivarium/core/experiment.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | vivarium/core/experiment.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | """
==========================================
Experiment, Compartment, and Store Classes
==========================================
"""
from __future__ import absolute_import, division, print_function
import os
import copy
import random
import datetime
import numpy as np
import logging as log
import pprint
pretty... | 34.132919 | 109 | 0.507962 |
from __future__ import absolute_import, division, print_function
import os
import copy
import random
import datetime
import numpy as np
import logging as log
import pprint
pretty=pprint.PrettyPrinter(indent=2)
def pp(x):
pretty.pprint(x)
def pf(x):
return pretty.pformat(x)
from vivarium.library.units im... | true | true |
1c42bdc5fc14b0c0b376f93d59c871b4d33bc477 | 7,831 | py | Python | job_app/views.py | dtlisir/app0508 | 35cdddfd794996365ab16dc77ed601926fa2ec64 | [
"Apache-2.0"
] | null | null | null | job_app/views.py | dtlisir/app0508 | 35cdddfd794996365ab16dc77ed601926fa2ec64 | [
"Apache-2.0"
] | null | null | null | job_app/views.py | dtlisir/app0508 | 35cdddfd794996365ab16dc77ed601926fa2ec64 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import base64
import datetime
import json
import time
from common.mymako import render_mako_context, render_json, render_mako_tostring
from blueking.component.shortcuts import get_client_by_request
from job_app.models import Script, Operation
from celery.task import task
def execute_job(reque... | 29.662879 | 108 | 0.573107 |
import base64
import datetime
import json
import time
from common.mymako import render_mako_context, render_json, render_mako_tostring
from blueking.component.shortcuts import get_client_by_request
from job_app.models import Script, Operation
from celery.task import task
def execute_job(request):
result, biz_li... | true | true |
1c42be6a0446f6886d76b5202b31d923edd72148 | 420 | py | Python | app/api/__init__.py | danofsatx/resources_api | 664532ee3ab4cb7c5000166d84ba371cf8b7713a | [
"MIT"
] | null | null | null | app/api/__init__.py | danofsatx/resources_api | 664532ee3ab4cb7c5000166d84ba371cf8b7713a | [
"MIT"
] | null | null | null | app/api/__init__.py | danofsatx/resources_api | 664532ee3ab4cb7c5000166d84ba371cf8b7713a | [
"MIT"
] | null | null | null | from flask import Blueprint
from flask_cors import CORS
bp = Blueprint('api', __name__)
ALLOWED_ORIGINS = [
'http://localhost:3000',
r"https:\/\/(www\.)?operationcode\.org",
r"https:\/\/(.*\.)?operation-code(-.*)?\.now\.sh"
]
CORS(bp, origins=ALLOWED_ORIGINS)
# We need to import the routes here so they ... | 24.705882 | 59 | 0.690476 | from flask import Blueprint
from flask_cors import CORS
bp = Blueprint('api', __name__)
ALLOWED_ORIGINS = [
'http://localhost:3000',
r"https:\/\/(www\.)?operationcode\.org",
r"https:\/\/(.*\.)?operation-code(-.*)?\.now\.sh"
]
CORS(bp, origins=ALLOWED_ORIGINS)
from app.api import routes
| true | true |
1c42be90e6576d03ab878dec3b493cd6cd0318d8 | 1,115 | py | Python | homework04-python-scientific-ecosystem/exercise 4 code.py | Bokubst/homework-scientific-computing | 4a7e1f896ad19ed55260a584bee2d6d6521de78b | [
"MIT"
] | 1 | 2020-03-26T11:53:59.000Z | 2020-03-26T11:53:59.000Z | homework04-python-scientific-ecosystem/exercise 4 code.py | Bokubst/homework-scientific-computing | 4a7e1f896ad19ed55260a584bee2d6d6521de78b | [
"MIT"
] | null | null | null | homework04-python-scientific-ecosystem/exercise 4 code.py | Bokubst/homework-scientific-computing | 4a7e1f896ad19ed55260a584bee2d6d6521de78b | [
"MIT"
] | null | null | null | import numpy as np
random1 = np.random.uniform(size=100)
print("random1 values")
print(random1 , "\n")
random2 = np.random.uniform(size=100)
print("random2 values")
print(random2 , "\n")
from matplotlib import pyplot as plt
plt.plot(random1, label = 'random number 1')
plt.title('random number 1')
ran_mean1 = [np.me... | 24.23913 | 47 | 0.721973 | import numpy as np
random1 = np.random.uniform(size=100)
print("random1 values")
print(random1 , "\n")
random2 = np.random.uniform(size=100)
print("random2 values")
print(random2 , "\n")
from matplotlib import pyplot as plt
plt.plot(random1, label = 'random number 1')
plt.title('random number 1')
ran_mean1 = [np.me... | true | true |
1c42bf6645c9e6385037478dd4d3fa6a87397b59 | 2,888 | py | Python | tests/test_simple.py | resendislab/corda | 15f4a8e1a046c6191f22e46099dad10aafb1fdce | [
"MIT"
] | 9 | 2017-08-21T09:44:19.000Z | 2021-09-22T12:18:06.000Z | tests/test_simple.py | resendislab/corda | 15f4a8e1a046c6191f22e46099dad10aafb1fdce | [
"MIT"
] | 9 | 2017-08-23T15:50:39.000Z | 2021-08-10T17:10:51.000Z | tests/test_simple.py | resendislab/corda | 15f4a8e1a046c6191f22e46099dad10aafb1fdce | [
"MIT"
] | 7 | 2017-09-12T12:50:10.000Z | 2021-02-22T18:42:15.000Z | # tests.py
#
# Copyright 2016 Christian Diener <mail[at]cdiener.com>
#
# MIT license. See LICENSE for more information.
import pytest
from corda import CORDA
from cobra import Model, Reaction, Metabolite
@pytest.fixture
def model():
A = Metabolite("A")
B = Metabolite("B")
C = Metabolite("C")
r1 = ... | 29.171717 | 63 | 0.572368 |
import pytest
from corda import CORDA
from cobra import Model, Reaction, Metabolite
@pytest.fixture
def model():
A = Metabolite("A")
B = Metabolite("B")
C = Metabolite("C")
r1 = Reaction("r1")
r1.add_metabolites({A: -1, C: 1})
r2 = Reaction("r2")
r2.add_metabolites({B: -1, C: 1})
... | true | true |
1c42c00bdb42ef4e18df5e1c266ee6dd86e9088b | 58,194 | py | Python | tests/test_redshift/test_redshift.py | irahulranjan/moto | e7fdb633adc75b0e0dec9e5bc04daed697582802 | [
"Apache-2.0"
] | null | null | null | tests/test_redshift/test_redshift.py | irahulranjan/moto | e7fdb633adc75b0e0dec9e5bc04daed697582802 | [
"Apache-2.0"
] | null | null | null | tests/test_redshift/test_redshift.py | irahulranjan/moto | e7fdb633adc75b0e0dec9e5bc04daed697582802 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import time
import datetime
import boto
import boto3
from boto.redshift.exceptions import (
ClusterNotFound,
ClusterParameterGroupNotFound,
ClusterSecurityGroupNotFound,
ClusterSubnetGroupNotFound,
InvalidSubnet,
)
from botocore.exceptions import ClientError... | 36.485266 | 98 | 0.713458 | from __future__ import unicode_literals
import time
import datetime
import boto
import boto3
from boto.redshift.exceptions import (
ClusterNotFound,
ClusterParameterGroupNotFound,
ClusterSecurityGroupNotFound,
ClusterSubnetGroupNotFound,
InvalidSubnet,
)
from botocore.exceptions import ClientError... | true | true |
1c42c06511b97c7aad9b785dc67f6719e18c7817 | 2,070 | py | Python | webcrawling/crawl.py | py-paulo/EstanteVirtual-WebCrawling | 8888857c3d97c6127a34ae8d83a1828eb9d9805d | [
"MIT"
] | null | null | null | webcrawling/crawl.py | py-paulo/EstanteVirtual-WebCrawling | 8888857c3d97c6127a34ae8d83a1828eb9d9805d | [
"MIT"
] | null | null | null | webcrawling/crawl.py | py-paulo/EstanteVirtual-WebCrawling | 8888857c3d97c6127a34ae8d83a1828eb9d9805d | [
"MIT"
] | null | null | null | import urllib.request
from bs4 import BeautifulSoup
def _crawl(urlBase, query, headers, waitRequests, attrs, allBooks: list = []):
req = urllib.request.Request(urlBase+query, headers=headers)
with urllib.request.urlopen(req) as response:
html = response.read().decode('utf-8', errors='ignore')
soup... | 40.588235 | 108 | 0.636715 | import urllib.request
from bs4 import BeautifulSoup
def _crawl(urlBase, query, headers, waitRequests, attrs, allBooks: list = []):
req = urllib.request.Request(urlBase+query, headers=headers)
with urllib.request.urlopen(req) as response:
html = response.read().decode('utf-8', errors='ignore')
soup... | true | true |
1c42c15ca0d1d2c95102c4142fea54eca013eabc | 4,186 | py | Python | classy_vision/dataset/__init__.py | jerryzh168/ClassyVision-1 | 6acfb00a77487a9015803fbaad805330081293a9 | [
"MIT"
] | 1 | 2021-09-29T06:24:42.000Z | 2021-09-29T06:24:42.000Z | classy_vision/dataset/__init__.py | pkassotis/ClassyVision | e8704ecaa59a15dbb2f4b0724e85d6e5cb2f704e | [
"MIT"
] | null | null | null | classy_vision/dataset/__init__.py | pkassotis/ClassyVision | e8704ecaa59a15dbb2f4b0724e85d6e5cb2f704e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import traceback
from pathlib import Path
from classy_vision.generic.registry_utils import import_all_modules
from .c... | 35.777778 | 88 | 0.718586 |
import traceback
from pathlib import Path
from classy_vision.generic.registry_utils import import_all_modules
from .classy_dataset import ClassyDataset
FILE_ROOT = Path(__file__).parent
DATASET_REGISTRY = {}
DATASET_REGISTRY_TB = {}
DATASET_CLASS_NAMES = set()
DATASET_CLASS_NAMES_TB = {}
def build_dataset(... | true | true |
1c42c1d0a350755214fa2e9158a141b2ae61aa55 | 16,452 | py | Python | django/contrib/messages/tests/base.py | laurilarjo/halvinbensa-appengine | 82602835914e70b6c71993d4b570e1df32a0e71e | [
"BSD-3-Clause"
] | 2 | 2015-11-05T06:07:13.000Z | 2019-01-04T07:35:59.000Z | django/contrib/messages/tests/base.py | alex/django-old | 6f964c8f03e5d25c9e36898a001c8463f82fbb81 | [
"BSD-3-Clause"
] | null | null | null | django/contrib/messages/tests/base.py | alex/django-old | 6f964c8f03e5d25c9e36898a001c8463f82fbb81 | [
"BSD-3-Clause"
] | null | null | null | import warnings
from django import http
from django.test import TestCase
from django.conf import settings
from django.utils.translation import ugettext_lazy
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.sto... | 40.224939 | 79 | 0.630075 | import warnings
from django import http
from django.test import TestCase
from django.conf import settings
from django.utils.translation import ugettext_lazy
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.sto... | true | true |
1c42c274cc43a339dc57293f185ce46a81f01cbc | 745 | py | Python | parquet/parquet/generate_make.py | ZornitsaD/IMCtermite | c9f8097c9b40e3fca58e89ecbf62579cd2904d6c | [
"MIT"
] | 1 | 2021-08-06T12:09:07.000Z | 2021-08-06T12:09:07.000Z | parquet/parquet/generate_make.py | ZornitsaD/IMCtermite | c9f8097c9b40e3fca58e89ecbf62579cd2904d6c | [
"MIT"
] | null | null | null | parquet/parquet/generate_make.py | ZornitsaD/IMCtermite | c9f8097c9b40e3fca58e89ecbf62579cd2904d6c | [
"MIT"
] | null | null | null | #-----------------------------------------------------------------------------#
import glob
from pathlib import Path
# find source files
srcpaths = Path("src/").rglob('*.cc')
deps =[ str(path) for path in srcpaths ]
print(deps)
with open('makefileobj','w') as fout :
for el in deps :
basnam = el.split('/... | 31.041667 | 80 | 0.387919 |
import glob
from pathlib import Path
srcpaths = Path("src/").rglob('*.cc')
deps =[ str(path) for path in srcpaths ]
print(deps)
with open('makefileobj','w') as fout :
for el in deps :
basnam = el.split('/')[-1]
print(str(el) + " : " + str(basnam) + " : " + str(basnam.split('.')[1]))
if ... | true | true |
1c42c337adbeca6fac36132c61930e57b93567cb | 3,675 | py | Python | base.py | HongtaoYang/mean-average-precision | 84a4b72f07e9143948319b75a2b50f1d371a0b11 | [
"MIT"
] | null | null | null | base.py | HongtaoYang/mean-average-precision | 84a4b72f07e9143948319b75a2b50f1d371a0b11 | [
"MIT"
] | null | null | null | base.py | HongtaoYang/mean-average-precision | 84a4b72f07e9143948319b75a2b50f1d371a0b11 | [
"MIT"
] | null | null | null | from abc import abstractmethod
from typing import List, Any, Set
import numpy as np
class GroundTruthItem:
def __init__(self, *, clazz: str, location: Any = None) -> None:
"""
Args:
clazz: the class of the item.
location: the location of the item.
In the ca... | 39.516129 | 114 | 0.631293 | from abc import abstractmethod
from typing import List, Any, Set
import numpy as np
class GroundTruthItem:
def __init__(self, *, clazz: str, location: Any = None) -> None:
self.clazz = clazz
self.location = location
class PredictedItem:
def __init__(self, *, clazz: str, score: float, locati... | true | true |
1c42c3380e433597471687a6ff54a59d9b36fc13 | 9,559 | py | Python | sdk/python/pulumi_azure_native/apimanagement/v20170301/policy.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/apimanagement/v20170301/policy.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/apimanagement/v20170301/policy.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 46.178744 | 1,372 | 0.660529 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = ['PolicyArgs', 'Policy']
@pulumi.input_type
class PolicyArgs:
def __init__(__self__, *,
policy_content: pulumi.Input[str],
... | true | true |
1c42c346b7d8ebd384f360f78261259aca83cf1f | 4,471 | py | Python | splitter/tracking/contour.py | splitter-research/splitter | 94e5e3073b4f383ba50397168ddb8bcd5fc48da4 | [
"MIT"
] | null | null | null | splitter/tracking/contour.py | splitter-research/splitter | 94e5e3073b4f383ba50397168ddb8bcd5fc48da4 | [
"MIT"
] | null | null | null | splitter/tracking/contour.py | splitter-research/splitter | 94e5e3073b4f383ba50397168ddb8bcd5fc48da4 | [
"MIT"
] | null | null | null | """This file is part of Splitter which is released under MIT License.
contour.py defines geometric vision primitives.
"""
from splitter.dataflow.map import Map
from timeit import default_timer as timer
import cv2
import numpy as np
class KeyPoints(Map):
"""KeyPoints uses a canny edge detector for identifying any ob... | 23.286458 | 92 | 0.634086 |
from splitter.dataflow.map import Map
from timeit import default_timer as timer
import cv2
import numpy as np
class KeyPoints(Map):
def __init__(self, \
blur=5, \
edge_low=225, \
edge_high=250, \
area_thresh=10,
label="object"):
self.blur = blur
self.edge_low = edge_low
self.edge_hig... | true | true |
1c42c40cb76b0a6c0c2b120e061b0d8dbe4119a3 | 400 | py | Python | sentiment/sentiment/urls.py | Ernesttt/sentiment-analysis | 60b8924457d35228d5a752d99dd6e786fb49ce55 | [
"BSD-3-Clause"
] | 1 | 2017-07-19T09:19:56.000Z | 2017-07-19T09:19:56.000Z | sentiment/sentiment/urls.py | Ernesttt/sentiment-analysis | 60b8924457d35228d5a752d99dd6e786fb49ce55 | [
"BSD-3-Clause"
] | null | null | null | sentiment/sentiment/urls.py | Ernesttt/sentiment-analysis | 60b8924457d35228d5a752d99dd6e786fb49ce55 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'tutorial.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('... | 26.666667 | 59 | 0.6475 | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('comments.urls')),
url(r'^docs/', include('rest_framework_swagger.urls')),
)
| true | true |
1c42c45221e6945826ce4c91f329d98e3103d776 | 2,061 | py | Python | integration/experiment/energy_efficiency/run_barrier_frequency_sweep_nekbone.py | scoumeri/geopm | 2406b8cca92d8eb32d4dc26d24bb2273164f186c | [
"BSD-3-Clause"
] | null | null | null | integration/experiment/energy_efficiency/run_barrier_frequency_sweep_nekbone.py | scoumeri/geopm | 2406b8cca92d8eb32d4dc26d24bb2273164f186c | [
"BSD-3-Clause"
] | null | null | null | integration/experiment/energy_efficiency/run_barrier_frequency_sweep_nekbone.py | scoumeri/geopm | 2406b8cca92d8eb32d4dc26d24bb2273164f186c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2015 - 2022, Intel Corporation
#
# 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, th... | 42.9375 | 74 | 0.761281 |
from experiment.energy_efficiency import barrier_frequency_sweep
from apps.nekbone import nekbone
if __name__ == '__main__':
app_conf_ref = nekbone.NekboneAppConf(add_barriers=False)
app_conf = nekbone.NekboneAppConf(add_barriers=True)
barrier_frequency_sweep.main(app_co... | true | true |
1c42c466300530f7aafff809cb4089893d0cfaa9 | 20,223 | py | Python | tests/rest/client/test_third_party_rules.py | sowieta/synapse | bfd7a9b65c5e092c6a7ccdd46e59a278b1cbbd57 | [
"Apache-2.0"
] | 1 | 2021-12-30T23:47:29.000Z | 2021-12-30T23:47:29.000Z | tests/rest/client/test_third_party_rules.py | sowieta/synapse | bfd7a9b65c5e092c6a7ccdd46e59a278b1cbbd57 | [
"Apache-2.0"
] | null | null | null | tests/rest/client/test_third_party_rules.py | sowieta/synapse | bfd7a9b65c5e092c6a7ccdd46e59a278b1cbbd57 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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... | 37.106422 | 104 | 0.590615 |
import threading
from typing import TYPE_CHECKING, Dict, Optional, Tuple
from unittest.mock import Mock
from synapse.api.constants import EventTypes, Membership
from synapse.api.errors import SynapseError
from synapse.events import EventBase
from synapse.events.third_party_rules import load_legacy_third_p... | true | true |
1c42c4720905e5eb9eed4993cfdc917e4749e9a9 | 201 | py | Python | Download Manager/download_append.py | guptachetan1997/crawling-projects | 36b9f568cd246a1d8d25b89ad83b33ba0c67bf4d | [
"MIT"
] | 69 | 2016-06-16T02:25:31.000Z | 2022-03-03T09:36:15.000Z | Youtube Download Manager/download_append.py | MohanSha/PyWebCrawling | be4d87c750ab2017bbc28ec48a345384073bab23 | [
"MIT"
] | 1 | 2018-09-21T12:27:00.000Z | 2018-09-21T12:27:00.000Z | Download Manager/download_append.py | guptachetan1997/crawling-projects | 36b9f568cd246a1d8d25b89ad83b33ba0c67bf4d | [
"MIT"
] | 24 | 2016-11-06T14:03:56.000Z | 2022-03-25T14:16:11.000Z | import sys
def main():
try:
url = str(sys.argv[1]) + '\n'
with open('list.txt', 'a') as file:
file.write(url)
except:
print("Print some error occured")
if __name__ == '__main__':
main()
| 16.75 | 37 | 0.606965 | import sys
def main():
try:
url = str(sys.argv[1]) + '\n'
with open('list.txt', 'a') as file:
file.write(url)
except:
print("Print some error occured")
if __name__ == '__main__':
main()
| true | true |
1c42c4c0cfc60ac65e3178923c0cf37f8e02a12b | 20 | py | Python | skinnywms/__init__.py | cosunae/skinnywms | 43092858ec6faa8b3723c54d5abc910cafe22f05 | [
"Apache-2.0"
] | null | null | null | skinnywms/__init__.py | cosunae/skinnywms | 43092858ec6faa8b3723c54d5abc910cafe22f05 | [
"Apache-2.0"
] | null | null | null | skinnywms/__init__.py | cosunae/skinnywms | 43092858ec6faa8b3723c54d5abc910cafe22f05 | [
"Apache-2.0"
] | null | null | null | __version__ ="0.1.3" | 20 | 20 | 0.7 | __version__ ="0.1.3" | true | true |
1c42c4f659f5cb271c6a09894212a8ed333056c9 | 11,707 | py | Python | veriloggen/stream/stream.py | leonardt/veriloggen | bc3dacaa6a3e0b0652763881d0edf0421c6d3189 | [
"Apache-2.0"
] | null | null | null | veriloggen/stream/stream.py | leonardt/veriloggen | bc3dacaa6a3e0b0652763881d0edf0421c6d3189 | [
"Apache-2.0"
] | null | null | null | veriloggen/stream/stream.py | leonardt/veriloggen | bc3dacaa6a3e0b0652763881d0edf0421c6d3189 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import copy
import functools
from collections import OrderedDict
import veriloggen.core.vtypes as vtypes
from veriloggen.core.module import Module
from veriloggen.seq.seq import Seq
from . import visitor
from . import s... | 31.47043 | 92 | 0.544717 | from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import copy
import functools
from collections import OrderedDict
import veriloggen.core.vtypes as vtypes
from veriloggen.core.module import Module
from veriloggen.seq.seq import Seq
from . import visitor
from . import s... | true | true |
1c42c5c925d219979a79b7f44ab8b58d315251c5 | 645 | py | Python | legacy/dx/simulator/sim.py | GaloisInc/adapt | 2ccff778d3e77505899266572f8f7caacb5b630f | [
"BSD-3-Clause"
] | 2 | 2020-04-09T13:04:25.000Z | 2021-09-24T14:17:26.000Z | legacy/dx/simulator/sim.py | GaloisInc/adapt | 2ccff778d3e77505899266572f8f7caacb5b630f | [
"BSD-3-Clause"
] | null | null | null | legacy/dx/simulator/sim.py | GaloisInc/adapt | 2ccff778d3e77505899266572f8f7caacb5b630f | [
"BSD-3-Clause"
] | 3 | 2019-09-20T20:49:54.000Z | 2021-09-02T17:33:47.000Z | import sys
import simulator_diagnoser as sd
if __name__ == "__main__":
config = sd.ConfigParser()
grammar = config.get_grammar()
graph = config.get_graph()
symptoms = config.get_symptoms()
dx = sd.SimpleDiagnoser(grammar)
dxs = dx.diagnose(graph, symptoms)
if len(sys.argv) == 1:
... | 25.8 | 57 | 0.578295 | import sys
import simulator_diagnoser as sd
if __name__ == "__main__":
config = sd.ConfigParser()
grammar = config.get_grammar()
graph = config.get_graph()
symptoms = config.get_symptoms()
dx = sd.SimpleDiagnoser(grammar)
dxs = dx.diagnose(graph, symptoms)
if len(sys.argv) == 1:
... | true | true |
1c42c62f498f527ae7dec66fc029f21f4ea4bd7d | 3,322 | py | Python | code_v3/edges_style.py | souleater42/MMP-Robotic-Artist | 2a67b611c2a3af5feb34276c0d3d30340667f1fa | [
"MIT"
] | 1 | 2020-02-20T05:11:31.000Z | 2020-02-20T05:11:31.000Z | code_v3/edges_style.py | souleater42/MMP-Robotic-Artist | 2a67b611c2a3af5feb34276c0d3d30340667f1fa | [
"MIT"
] | null | null | null | code_v3/edges_style.py | souleater42/MMP-Robotic-Artist | 2a67b611c2a3af5feb34276c0d3d30340667f1fa | [
"MIT"
] | null | null | null | """
Summary => will apply the EdgesStlye to the image given.
Description => This class is going to control the proccessing of images for
the EdgesStlye. It will take a the 'takenPicture.jpg'
from the Image folder and then stlye it. The output will
be a list of x and y coordinates fo... | 35.72043 | 79 | 0.612884 | from __future__ import division
from image_processor import ImageProcessor
import numpy as np
import cv2
class EdgesStyle(ImageProcessor):
def __init__(self):
super(EdgesStyle, self).__init__()
def run(self):
img = cv2.imread('Images/takenPicture.jpg', 0)
img = self... | true | true |
1c42c73b027b903d89ebc1a31c82e9ad56719dc8 | 874 | py | Python | setup.py | alehuo/pyoidc-redis-session-backend | a24af967e9e5fa59aaa2511190db355b53d7d2dd | [
"MIT"
] | 3 | 2020-07-22T11:14:13.000Z | 2022-02-28T21:22:30.000Z | setup.py | alehuo/pyoidc-redis-session-backend | a24af967e9e5fa59aaa2511190db355b53d7d2dd | [
"MIT"
] | null | null | null | setup.py | alehuo/pyoidc-redis-session-backend | a24af967e9e5fa59aaa2511190db355b53d7d2dd | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pyoidc-redis-session-backend",
version="1.0.3",
author="alehuo",
author_email="aleksi.huotala@helsinki.fi",
description="Redis-based session storage for oic library",
long_description=... | 34.96 | 85 | 0.687643 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="pyoidc-redis-session-backend",
version="1.0.3",
author="alehuo",
author_email="aleksi.huotala@helsinki.fi",
description="Redis-based session storage for oic library",
long_description=... | true | true |
1c42c7432f025b78306fefdf7615f8f1c304bccc | 747 | py | Python | blog/migrations/0005_auto_20201017_2048.py | flo-ui/codingforengineers | b4bee0feec51e3cb7c06b6b493593ae01256b77d | [
"Apache-2.0"
] | null | null | null | blog/migrations/0005_auto_20201017_2048.py | flo-ui/codingforengineers | b4bee0feec51e3cb7c06b6b493593ae01256b77d | [
"Apache-2.0"
] | 7 | 2020-10-07T09:18:05.000Z | 2021-09-22T19:41:25.000Z | blog/migrations/0005_auto_20201017_2048.py | flo-ui/codingforengineers | b4bee0feec51e3cb7c06b6b493593ae01256b77d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.2 on 2020-10-17 20:48
from django.db import migrations
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', '0003_taggeditem_add_unique_index'),
('blog', '0004_auto_20200924_0914'),
]
operations = [
migrations.Remov... | 25.758621 | 162 | 0.603748 |
from django.db import migrations
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('taggit', '0003_taggeditem_add_unique_index'),
('blog', '0004_auto_20200924_0914'),
]
operations = [
migrations.RemoveField(
model_name='blogpost',
... | true | true |
1c42c7f86de3c444721f82b1b3dde3b0e837b579 | 355 | py | Python | hopechannelfi/settings/production.py | AdventistChurchFinland/hopechannel-wagtail | b5b06e0696a929d5d2e29a368002d27f54a8ff75 | [
"MIT"
] | null | null | null | hopechannelfi/settings/production.py | AdventistChurchFinland/hopechannel-wagtail | b5b06e0696a929d5d2e29a368002d27f54a8ff75 | [
"MIT"
] | 9 | 2020-06-05T23:26:12.000Z | 2021-06-17T20:23:14.000Z | hopechannelfi/settings/production.py | AdventistChurchFinland/hopechannel-wagtail | b5b06e0696a929d5d2e29a368002d27f54a8ff75 | [
"MIT"
] | null | null | null | from .base import *
DEBUG = False
# Security settings
SECURE_BROWSER_XSS_FILTER = True
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_DOMAIN = "cms.hopechannel.fi"
CSRF_COOKIE_SECURE = True
CSRF_TRUSTED_ORIGINS = ['cms.hopechannel.fi']
try:
from .local imp... | 18.684211 | 45 | 0.785915 | from .base import *
DEBUG = False
SECURE_BROWSER_XSS_FILTER = True
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_DOMAIN = "cms.hopechannel.fi"
CSRF_COOKIE_SECURE = True
CSRF_TRUSTED_ORIGINS = ['cms.hopechannel.fi']
try:
from .local import *
except Import... | true | true |
1c42c853d3067b192d5b242f63fcef0af32997c1 | 16,441 | py | Python | fabfile.py | blowUA/mezz | caf909ad6dd48a61e735bbff7203573f0a61c0d7 | [
"MIT"
] | 209 | 2015-02-06T02:24:22.000Z | 2022-03-07T23:39:28.000Z | fabfile.py | blowUA/mezz | caf909ad6dd48a61e735bbff7203573f0a61c0d7 | [
"MIT"
] | 12 | 2015-08-25T19:06:27.000Z | 2021-12-26T09:46:30.000Z | fabfile.py | blowUA/mezz | caf909ad6dd48a61e735bbff7203573f0a61c0d7 | [
"MIT"
] | 92 | 2015-03-04T11:13:55.000Z | 2020-10-23T06:46:42.000Z | from __future__ import print_function, unicode_literals
from future.builtins import input, open
import os
import re
import sys
from functools import wraps
from getpass import getpass, getuser
from glob import glob
from contextlib import contextmanager
from posixpath import join
from fabric.api import env, cd, prefix,... | 30.222426 | 78 | 0.58342 | from __future__ import print_function, unicode_literals
from future.builtins import input, open
import os
import re
import sys
from functools import wraps
from getpass import getpass, getuser
from glob import glob
from contextlib import contextmanager
from posixpath import join
from fabric.api import env, cd, prefix,... | true | true |
1c42c91e8d558d79cc62fc0ff2d24ade178577e2 | 7,537 | py | Python | brats/train2d.py | vuhoangminh/medical-segmentation | 4a2a663d1f2d6de5c78bc521f6ed2aa1681a8804 | [
"MIT"
] | 1 | 2018-12-06T09:17:26.000Z | 2018-12-06T09:17:26.000Z | brats/train2d.py | vuhoangminh/medical-segmentation | 4a2a663d1f2d6de5c78bc521f6ed2aa1681a8804 | [
"MIT"
] | null | null | null | brats/train2d.py | vuhoangminh/medical-segmentation | 4a2a663d1f2d6de5c78bc521f6ed2aa1681a8804 | [
"MIT"
] | 2 | 2019-05-07T10:07:33.000Z | 2019-05-20T12:50:37.000Z | from comet_ml import Experiment
# to compute memory consumption ----------------------------------
# import tensorflow as tf
# from keras.backend.tensorflow_backend import set_session
# config_tf = tf.ConfigProto()
# config_tf.gpu_options.per_process_gpu_memory_fraction = 0.015
# config_tf.gpu_options.visible_device_l... | 39.051813 | 132 | 0.641104 | from comet_ml import Experiment
from brats.config import config, config_unet
from unet3d.utils.print_utils import print_section
from brats.prepare_data import prepare_data
import unet3d.utils.args_utils as get_args
from unet3d.utils.path_utils import get_training_h5_paths
from unet3d.utils.path_utils import ... | true | true |
1c42cc21158e0c14963552c6317818dfbff51627 | 943 | py | Python | stdplugins/ding.py | spiderthehacker/PornHub | 216535af2cf0ae052fe975c28ad37b422c7ef813 | [
"Apache-2.0"
] | null | null | null | stdplugins/ding.py | spiderthehacker/PornHub | 216535af2cf0ae052fe975c28ad37b422c7ef813 | [
"Apache-2.0"
] | null | null | null | stdplugins/ding.py | spiderthehacker/PornHub | 216535af2cf0ae052fe975c28ad37b422c7ef813 | [
"Apache-2.0"
] | null | null | null | """Emoji
Available Commands:
.ding"""
from telethon import events
import asyncio
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.3
animation_ttl = range(0, 10)
input_str = event.pattern_match.group(... | 17.792453 | 61 | 0.412513 |
from telethon import events
import asyncio
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.3
animation_ttl = range(0, 10)
input_str = event.pattern_match.group(1)
if input_str == "ding":
... | true | true |
1c42cc6a3f8c0764f09509d8cc4221f81b2264eb | 5,078 | py | Python | onlinecourse/models.py | jalsop24/django_project | 40aaa5d82d4b9ad36136d6ca2811002d901895f4 | [
"Apache-2.0"
] | null | null | null | onlinecourse/models.py | jalsop24/django_project | 40aaa5d82d4b9ad36136d6ca2811002d901895f4 | [
"Apache-2.0"
] | null | null | null | onlinecourse/models.py | jalsop24/django_project | 40aaa5d82d4b9ad36136d6ca2811002d901895f4 | [
"Apache-2.0"
] | null | null | null | import sys
from django.utils.timezone import now
try:
from django.db import models
except Exception:
print("There was an error loading django modules. Do you have django installed?")
sys.exit()
from django.conf import settings
import uuid
# Instructor model
class Instructor(models.Model):
user = mode... | 33.189542 | 104 | 0.690823 | import sys
from django.utils.timezone import now
try:
from django.db import models
except Exception:
print("There was an error loading django modules. Do you have django installed?")
sys.exit()
from django.conf import settings
import uuid
class Instructor(models.Model):
user = models.ForeignKey(
... | true | true |
1c42cc84c8ff433444247cd51154d826166f9214 | 4,303 | py | Python | classes/asset_content.py | CodeWringer/cookbookpy | 5b9fb44d591154962509aed3a2a7cbbc56ecd130 | [
"MIT"
] | null | null | null | classes/asset_content.py | CodeWringer/cookbookpy | 5b9fb44d591154962509aed3a2a7cbbc56ecd130 | [
"MIT"
] | null | null | null | classes/asset_content.py | CodeWringer/cookbookpy | 5b9fb44d591154962509aed3a2a7cbbc56ecd130 | [
"MIT"
] | null | null | null | from classes.asset import Asset
import os
import utility.io
from utility.io import get_new_ext
from utility.url import get_url
class AssetContent(Asset):
"""Base class for recipe/markdown assets."""
def __init__(self, path):
super().__init__(path)
self.parent = None # A Category object.
... | 36.466102 | 101 | 0.573553 | from classes.asset import Asset
import os
import utility.io
from utility.io import get_new_ext
from utility.url import get_url
class AssetContent(Asset):
def __init__(self, path):
super().__init__(path)
self.parent = None
self.title = self.get_section('Title')[0]
self.dest_name... | true | true |
1c42ccedd8ff09adddcc1cfdc255863184c47ec2 | 20,881 | py | Python | tests/core/test_TransactionPool.py | pur-token/pur-core | ce372be274262a839c45436dfee58ba4ea105074 | [
"MIT"
] | null | null | null | tests/core/test_TransactionPool.py | pur-token/pur-core | ce372be274262a839c45436dfee58ba4ea105074 | [
"MIT"
] | null | null | null | tests/core/test_TransactionPool.py | pur-token/pur-core | ce372be274262a839c45436dfee58ba4ea105074 | [
"MIT"
] | null | null | null | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from unittest import TestCase
from mock import Mock, patch
from pur.core.OptimizedAddressState import OptimizedAddressState
from pur.core.Block import Block
from pur.c... | 46.299335 | 119 | 0.704516 |
from unittest import TestCase
from mock import Mock, patch
from pur.core.OptimizedAddressState import OptimizedAddressState
from pur.core.Block import Block
from pur.core.State import State
from pur.core.ChainManager import ChainManager
from pur.core.txs.CoinBase import CoinBase
from pur.core.txs.TransferTransactio... | true | true |
1c42ccf8fd88a208f112d7e51a3524c270f106be | 28,847 | py | Python | src/python/pants/engine/internals/engine_test.py | cristianmatache/pants | 3def49fd11784b086b3e2e76bb9bcff09b43175b | [
"Apache-2.0"
] | null | null | null | src/python/pants/engine/internals/engine_test.py | cristianmatache/pants | 3def49fd11784b086b3e2e76bb9bcff09b43175b | [
"Apache-2.0"
] | null | null | null | src/python/pants/engine/internals/engine_test.py | cristianmatache/pants | 3def49fd11784b086b3e2e76bb9bcff09b43175b | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
import time
import unittest
from dataclasses import dataclass, field
from textwrap import dedent
from typing import List, Optional
from pants.engine.engine_aware import E... | 34.423628 | 122 | 0.636253 |
import itertools
import time
import unittest
from dataclasses import dataclass, field
from textwrap import dedent
from typing import List, Optional
from pants.engine.engine_aware import EngineAwareReturnType
from pants.engine.fs import (
EMPTY_FILE_DIGEST,
EMPTY_SNAPSHOT,
CreateDigest,
Digest,
D... | true | true |
1c42cf6f42fc0141cc2213b526517dda985712bd | 15,828 | py | Python | Cogs/Spotify2.py | kazoeru/Acinonyx-v3 | 6d202ee22179567b132010aeec34d51cd316913c | [
"MIT"
] | null | null | null | Cogs/Spotify2.py | kazoeru/Acinonyx-v3 | 6d202ee22179567b132010aeec34d51cd316913c | [
"MIT"
] | null | null | null | Cogs/Spotify2.py | kazoeru/Acinonyx-v3 | 6d202ee22179567b132010aeec34d51cd316913c | [
"MIT"
] | null | null | null | import discord
import spotipy
import os
import dropbox
import ffmpeg
import re
import subprocess
import asyncio
import json
from discord.ext import commands
from Cogs import Settings
from savify import Savify
from savify.types import Type, Format, Quality
from spotipy.oauth... | 63.312 | 383 | 0.529378 | import discord
import spotipy
import os
import dropbox
import ffmpeg
import re
import subprocess
import asyncio
import json
from discord.ext import commands
from Cogs import Settings
from savify import Savify
from savify.types import Type, Format, Quality
from spotipy.oauth... | true | true |
1c42cf9f6ce6702159b65b786d05168c119ecdd8 | 10,139 | py | Python | triangle.py | luigialberti/pytriangle | 99ecafc299a692ef0f33e262bc7a1c912d3aa694 | [
"MIT"
] | 8 | 2016-09-16T08:55:39.000Z | 2020-02-07T09:49:59.000Z | triangle.py | luigialberti/pytriangle | 99ecafc299a692ef0f33e262bc7a1c912d3aa694 | [
"MIT"
] | 5 | 2015-11-15T15:34:37.000Z | 2021-08-31T10:17:13.000Z | triangle.py | luigialberti/pytriangle | 99ecafc299a692ef0f33e262bc7a1c912d3aa694 | [
"MIT"
] | 3 | 2016-01-18T15:07:43.000Z | 2021-02-25T08:25:06.000Z | #!/usr/bin/env python
import triangulate
import sys
"""
Interface to the TRIANGLE program by Jonathan Richard Shewchuck
"""
class Triangle:
def __init__(self):
"""
Constructor
"""
# create handles to hold the
# triangulation structures
self.hndls = [triangulate... | 30.356287 | 140 | 0.547687 |
import triangulate
import sys
class Triangle:
def __init__(self):
self.hndls = [triangulate.new(),]
self.h_vor = triangulate.new()
self.area = None
self.mode = ''
self.has_points = False
self.has_segmts = False
self.has_t... | true | true |
1c42d0c6c4bef2adc42ca9de02a957245b99fc80 | 4,708 | py | Python | script.module.exodus/lib/resources/lib/sources/ru/exfs.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 1 | 2019-03-05T09:38:10.000Z | 2019-03-05T09:38:10.000Z | script.module.exodus/lib/resources/lib/sources/ru/exfs.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | null | null | null | script.module.exodus/lib/resources/lib/sources/ru/exfs.py | TheWardoctor/wardoctors-repo | 893f646d9e27251ffc00ca5f918e4eb859a5c8f0 | [
"Apache-2.0"
] | 1 | 2021-11-05T20:48:09.000Z | 2021-11-05T20:48:09.000Z | # -*- coding: utf-8 -*-
"""
Exodus Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... | 38.276423 | 193 | 0.569456 |
import re
import urllib
import urlparse
from resources.lib.sources.ru.lib import moonwalk
from resources.lib.sources.ru.lib import utils
from resources.lib.modules import cleantitle
from resources.lib.modules import client
from resources.lib.modules import source_utils
from resources.lib.modules import dom_parser
... | true | true |
1c42d104334a1108c87083bd4fcb174c411cc6dd | 2,699 | py | Python | Environnement/Environnement.py | OctThe16th/BetterTrainingDataMnist_RL_GAN | fcc75c9ddf768d7c66c9fade3e86973a4c828624 | [
"MIT"
] | null | null | null | Environnement/Environnement.py | OctThe16th/BetterTrainingDataMnist_RL_GAN | fcc75c9ddf768d7c66c9fade3e86973a4c828624 | [
"MIT"
] | null | null | null | Environnement/Environnement.py | OctThe16th/BetterTrainingDataMnist_RL_GAN | fcc75c9ddf768d7c66c9fade3e86973a4c828624 | [
"MIT"
] | null | null | null | import numpy as np
from lightgbm import LGBMClassifier
from keras.datasets import mnist
from sklearn.metrics import f1_score
import warnings
warnings.filterwarnings("ignore")
class Environnement:
def __init__(self, amount_per_class):
self.amount_per_class = amount_per_class
(self.x_train, self.y_... | 39.115942 | 104 | 0.653946 | import numpy as np
from lightgbm import LGBMClassifier
from keras.datasets import mnist
from sklearn.metrics import f1_score
import warnings
warnings.filterwarnings("ignore")
class Environnement:
def __init__(self, amount_per_class):
self.amount_per_class = amount_per_class
(self.x_train, self.y_... | true | true |
1c42d1487d91f70af8fd59810e40bc48fec8d65b | 57 | py | Python | CodeWars/7 Kyu/Build a square.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Build a square.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | CodeWars/7 Kyu/Build a square.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | def generateShape(n):
return "\n".join(["+" * n] * n) | 28.5 | 35 | 0.526316 | def generateShape(n):
return "\n".join(["+" * n] * n) | true | true |
1c42d191e50517487ce29edd00a0d3e85b40a9be | 15,309 | py | Python | RocketSimulation.py | pietrotrope/SolarSystemSimulation | 905eec31eb73e1203ee23a32846954b30bbc5925 | [
"MIT"
] | null | null | null | RocketSimulation.py | pietrotrope/SolarSystemSimulation | 905eec31eb73e1203ee23a32846954b30bbc5925 | [
"MIT"
] | null | null | null | RocketSimulation.py | pietrotrope/SolarSystemSimulation | 905eec31eb73e1203ee23a32846954b30bbc5925 | [
"MIT"
] | null | null | null | import sys
import csv
import json
import math
import pygame
import numpy as np
from pygame.locals import *
import pandas as pd
from data import *
from agent import agentsList, Agent
global screenSize
screenSize = [1920, 1080]
def load_parameters(path):
package = []
file = open(path, 'r')
j = json.load(f... | 33.720264 | 118 | 0.528317 | import sys
import csv
import json
import math
import pygame
import numpy as np
from pygame.locals import *
import pandas as pd
from data import *
from agent import agentsList, Agent
global screenSize
screenSize = [1920, 1080]
def load_parameters(path):
package = []
file = open(path, 'r')
j = json.load(f... | true | true |
1c42d2a7b9a24fe9fa7a92db6edb25a00cd190ee | 7,223 | py | Python | evaluate.py | wilsonloo/my_traffic_tf2_yolo3 | 322104de934794870822e1ea2494ee8228de2540 | [
"MIT"
] | 1 | 2021-07-02T01:44:40.000Z | 2021-07-02T01:44:40.000Z | evaluate.py | wilsonloo/my_traffic_tf2_yolo3 | 322104de934794870822e1ea2494ee8228de2540 | [
"MIT"
] | null | null | null | evaluate.py | wilsonloo/my_traffic_tf2_yolo3 | 322104de934794870822e1ea2494ee8228de2540 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# coding=utf-8
#================================================================
# Copyright (C) 2019 * Ltd. All rights reserved.
#
# Editor : VIM
# File name : evaluate.py
# Author : YunYang1994
# Created date: 2019-02-21 15:30:26
# Description :
#
#======================... | 42.239766 | 112 | 0.5686 |
import cv2
import os
import shutil
import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import core.utils as utils
from core.config import cfg
from core.yolov3 import YOLOV3
class YoloTest(object):
def __init__(self):
self.input_size = cfg.TEST.INPUT_SIZE
... | true | true |
1c42d415f4eb1f9c6c235e5b2f7f7495bf3abe7f | 275 | py | Python | CS_4320 Software Development 1/assignments/Sprint-4/SSO_Project/01-login/auth0login/urls.py | hickmanjv/hickmanjv | 390e22317b9ace552855897af19963ffb416b1b7 | [
"MIT"
] | null | null | null | CS_4320 Software Development 1/assignments/Sprint-4/SSO_Project/01-login/auth0login/urls.py | hickmanjv/hickmanjv | 390e22317b9ace552855897af19963ffb416b1b7 | [
"MIT"
] | null | null | null | CS_4320 Software Development 1/assignments/Sprint-4/SSO_Project/01-login/auth0login/urls.py | hickmanjv/hickmanjv | 390e22317b9ace552855897af19963ffb416b1b7 | [
"MIT"
] | null | null | null | from django.urls import path, include
from . import views
urlpatterns = [
path('', views.index),
path('dashboard', views.dashboard),
path('logout', views.logout),
path('', include('django.contrib.auth.urls')),
path('', include('social_django.urls')),
]
| 22.916667 | 50 | 0.650909 | from django.urls import path, include
from . import views
urlpatterns = [
path('', views.index),
path('dashboard', views.dashboard),
path('logout', views.logout),
path('', include('django.contrib.auth.urls')),
path('', include('social_django.urls')),
]
| true | true |
1c42d450691102fb5bc1c4a0d53bd558ecee17bb | 7,293 | py | Python | var/spack/repos/builtin/packages/grass/package.py | RemoteConnectionManager/spack | f2967b6c16effd26ce007cf86cadbb645c574f50 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2019-05-19T12:24:44.000Z | 2019-05-24T10:58:09.000Z | var/spack/repos/builtin/packages/grass/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 17 | 2018-09-20T18:32:50.000Z | 2019-12-04T16:58:12.000Z | var/spack/repos/builtin/packages/grass/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-09-21T07:45:10.000Z | 2019-09-21T07:45:10.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Grass(AutotoolsPackage):
"""GRASS GIS (Geographic Resources Analysis Support System), is a... | 35.231884 | 86 | 0.586864 |
from spack import *
class Grass(AutotoolsPackage):
homepage = "http://grass.osgeo.org"
version('7.6.1', '9ca74f9010d013f735737a90c65d8a7f')
version('7.4.4', '98ae22f8a97a83a4d99a537236639e9c')
version('7.4.3', '4f4462af7a95fe84ee21f3dd585dcb05')
version('7.4.2', 'bb3fc005e707f76... | true | true |
1c42d46121402d7f9d32a038eb5d12b43d8dc541 | 102 | py | Python | message_sender/apps.py | anisimovih/Message_sending_emulator | 7aaf52849625cf658f06503792c7dd8e3ba157fe | [
"MIT"
] | null | null | null | message_sender/apps.py | anisimovih/Message_sending_emulator | 7aaf52849625cf658f06503792c7dd8e3ba157fe | [
"MIT"
] | 6 | 2021-03-18T22:32:27.000Z | 2021-09-22T18:21:39.000Z | message_sender/apps.py | anisimovih/Message_sending_emulator | 7aaf52849625cf658f06503792c7dd8e3ba157fe | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MessageSenderConfig(AppConfig):
name = 'message_sender'
| 17 | 37 | 0.784314 | from django.apps import AppConfig
class MessageSenderConfig(AppConfig):
name = 'message_sender'
| true | true |
1c42d484665d3871711fa452207d4b87be303a80 | 28,770 | py | Python | lib/sqlalchemy/dialects/sybase/base.py | paylogic/sqlalchemy | 876a487bf06a038efde7d46ce09e253b9247aae5 | [
"MIT"
] | 5 | 2015-01-18T01:47:56.000Z | 2016-01-30T14:58:58.000Z | lib/sqlalchemy/dialects/sybase/base.py | mitsuhiko/sqlalchemy | 5a6895471fb6bf9afe9bdf017f1fa2c6246ae303 | [
"MIT"
] | null | null | null | lib/sqlalchemy/dialects/sybase/base.py | mitsuhiko/sqlalchemy | 5a6895471fb6bf9afe9bdf017f1fa2c6246ae303 | [
"MIT"
] | null | null | null | # sybase/base.py
# Copyright (C) 2010-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
# get_select_precolumns(), limit_clause() implementation
# copyright (C) 2007 Fisch Asset Management
# AG http://www.fam.ch, with coding by Alexander Houben
# alexander.houben@thor-solutions.ch
#
# This module is part ... | 35.300613 | 84 | 0.575739 |
import operator
import re
from sqlalchemy.sql import compiler, expression, text, bindparam
from sqlalchemy.engine import default, base, reflection
from sqlalchemy import types as sqltypes
from sqlalchemy.sql import operators as sql_operators
from sqlalchemy import schema as sa_schema
from sqlalchemy import u... | true | true |
1c42d6673b8c1236d5c417327374f950d9c36a31 | 22,994 | py | Python | scripts/NcbiTaxonomy/ncbitaxonomy.py | andrese52/CAMISIM | 7d1c3ce707deec8901fa9d5a40fd7f37478e65f5 | [
"Apache-2.0"
] | null | null | null | scripts/NcbiTaxonomy/ncbitaxonomy.py | andrese52/CAMISIM | 7d1c3ce707deec8901fa9d5a40fd7f37478e65f5 | [
"Apache-2.0"
] | null | null | null | scripts/NcbiTaxonomy/ncbitaxonomy.py | andrese52/CAMISIM | 7d1c3ce707deec8901fa9d5a40fd7f37478e65f5 | [
"Apache-2.0"
] | null | null | null | # original from Dmitrij Turaev
__author__ = 'Peter Hofmann'
__version__ = '0.1.5'
import os
import time
import fnmatch
import tempfile
from taxonomynode import TaxonomyNode
from scripts.Validator.validator import Validator
from scripts.Archive.archive import Archive
class NcbiTaxonomy(Validator):
"""
Loadi... | 39.508591 | 132 | 0.608507 |
__author__ = 'Peter Hofmann'
__version__ = '0.1.5'
import os
import time
import fnmatch
import tempfile
from taxonomynode import TaxonomyNode
from scripts.Validator.validator import Validator
from scripts.Archive.archive import Archive
class NcbiTaxonomy(Validator):
default_ordered_legal_ranks = ['supe... | true | true |
1c42d68381f4677860a1f3451ac7c0397a4af9f3 | 116,297 | py | Python | src/impurity/atomd/atom_d.py | dmft-wien2k/dmft-wien2k-v2 | 83481be27e8a9ff14b9635d6cc1cd9d96f053487 | [
"Apache-2.0"
] | 5 | 2021-05-13T13:04:26.000Z | 2022-01-18T10:08:09.000Z | src/impurity/atomd/atom_d.py | dmft-wien2k/dmft-wien2k-v2 | 83481be27e8a9ff14b9635d6cc1cd9d96f053487 | [
"Apache-2.0"
] | 2 | 2016-07-12T21:37:53.000Z | 2016-07-12T21:42:01.000Z | src/impurity/atomd/atom_d.py | dmft-wien2k/dmft-wien2k | 83481be27e8a9ff14b9635d6cc1cd9d96f053487 | [
"Apache-2.0"
] | 2 | 2016-07-22T15:46:56.000Z | 2016-08-02T15:05:12.000Z | #!/usr/bin/env python
# @Copyright 2007 Kristjan Haule
#
pycxx_available=True
symeig_available=False
from scipy import *
import sys, re, os
import copy
import getopt
import pickle
import glob
from numpy import linalg
import scipy
from distutils.version import StrictVersion
if StrictVersion(scipy.__version__) > Stric... | 37.612225 | 184 | 0.441963 |
pycxx_available=True
symeig_available=False
from scipy import *
import sys, re, os
import copy
import getopt
import pickle
import glob
from numpy import linalg
import scipy
from distutils.version import StrictVersion
if StrictVersion(scipy.__version__) > StrictVersion('0.19.0'):
import weave
else:
import s... | false | true |
1c42d6849c679e43dc2152022dd003a9307fffe0 | 1,386 | py | Python | tools/video/reader.py | nghiaplt/SlowFast | 326fd3c54408dab17d6383948a884a4d8f5da278 | [
"Apache-2.0"
] | null | null | null | tools/video/reader.py | nghiaplt/SlowFast | 326fd3c54408dab17d6383948a884a4d8f5da278 | [
"Apache-2.0"
] | null | null | null | tools/video/reader.py | nghiaplt/SlowFast | 326fd3c54408dab17d6383948a884a4d8f5da278 | [
"Apache-2.0"
] | null | null | null | import cv2
class VideoReader(object):
def __init__(self, cfg):
self.source = cfg.DEMO.DATA_SOURCE if cfg.DEMO.DATA_SOURCE != - \
1 else cfg.DEMO.DATA_VIDEO
self.display_width = cfg.DEMO.DISPLAY_WIDTH
self.display_height = cfg.DEMO.DISPLAY_HEIGHT
try: # OpenCV needs i... | 30.8 | 78 | 0.621212 | import cv2
class VideoReader(object):
def __init__(self, cfg):
self.source = cfg.DEMO.DATA_SOURCE if cfg.DEMO.DATA_SOURCE != - \
1 else cfg.DEMO.DATA_VIDEO
self.display_width = cfg.DEMO.DISPLAY_WIDTH
self.display_height = cfg.DEMO.DISPLAY_HEIGHT
try:
sel... | true | true |
1c42d8a2ddd5404915c72f7f80b16840660da047 | 13,271 | py | Python | log_mito_act/model_269.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_act/model_269.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_act/model_269.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', 'X... | 79.467066 | 614 | 0.809736 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', 'Xiap'])
Monomer('Fadd', ['Receptor'... | true | true |
1c42d8fac077eeaae5c8cc7c84694efe9c4c9b9c | 2,396 | py | Python | MarketVersion/ConsumerCES_original.py | ntuecon/2018groupCE | 51c4442bcae8fbd3841b12b8f87d5eefe11e23f8 | [
"MIT"
] | 3 | 2018-03-13T07:30:47.000Z | 2018-06-12T15:02:44.000Z | MarketVersion/ConsumerCES_original.py | ntuecon/2018groupCE | 51c4442bcae8fbd3841b12b8f87d5eefe11e23f8 | [
"MIT"
] | null | null | null | MarketVersion/ConsumerCES_original.py | ntuecon/2018groupCE | 51c4442bcae8fbd3841b12b8f87d5eefe11e23f8 | [
"MIT"
] | 1 | 2018-03-20T08:10:22.000Z | 2018-03-20T08:10:22.000Z | class Consumer:
"""This class is the optimization of individual choice of consumer"""
#def __init__(self,GoodPrices,FacPrices):
def __init__(self,alpha,beta,theta):
import numpy as np
#self.GoodPrices=np.array(GoodPrices)
#self.FacPrices=np.array(FacPrices)
self.alpha=np.arra... | 42.035088 | 199 | 0.597245 | class Consumer:
def __init__(self,alpha,beta,theta):
import numpy as np
self.alpha=np.array(alpha)
self.gamma=1.0
self.rho=0.0
self.beta=1.0*beta
self.theta=1.0*np.array(theta)
self.ng=len(self.alpha)
self.nf=len(self.theta)
... | true | true |
1c42d9b8fbcd7a21db15d1087e2f4fe97fb013bd | 376 | py | Python | apis/urls.py | jeffshek/betterself | 51468253fc31373eb96e0e82189b9413f3d76ff5 | [
"MIT"
] | 98 | 2017-07-29T14:26:36.000Z | 2022-02-28T04:10:15.000Z | apis/urls.py | jeffshek/betterself | 51468253fc31373eb96e0e82189b9413f3d76ff5 | [
"MIT"
] | 1,483 | 2017-05-30T00:05:56.000Z | 2022-03-31T12:37:06.000Z | apis/urls.py | lawrendran/betterself | 51468253fc31373eb96e0e82189b9413f3d76ff5 | [
"MIT"
] | 13 | 2017-11-08T00:02:35.000Z | 2022-02-28T04:10:32.000Z | from django.conf.urls import include, url
# note for api urls, even though app is plural, link is singular!
# aka /api/v1, NOT /apis/v1
urlpatterns = [
url(r'^v1/', include('apis.betterself.v1.urls')),
url(r'^v1/rescuetime/', include('apis.rescuetime.v1.urls')),
url(r'^fitbit/', include('apis.fitbit.urls')... | 34.181818 | 65 | 0.662234 | from django.conf.urls import include, url
urlpatterns = [
url(r'^v1/', include('apis.betterself.v1.urls')),
url(r'^v1/rescuetime/', include('apis.rescuetime.v1.urls')),
url(r'^fitbit/', include('apis.fitbit.urls')),
url(r'^twilio/', include('apis.twilio.urls')),
]
| true | true |
1c42dbdcbc2327f0dbb255eddbbde2de931a4503 | 1,043 | py | Python | third_party/mosquitto/test/broker/02-subpub-qos0.py | HowJMay/simple-tangle-accelerator | d79bfda23a0fcf67d5a7f9e66f02efa3e73ba381 | [
"MIT"
] | null | null | null | third_party/mosquitto/test/broker/02-subpub-qos0.py | HowJMay/simple-tangle-accelerator | d79bfda23a0fcf67d5a7f9e66f02efa3e73ba381 | [
"MIT"
] | null | null | null | third_party/mosquitto/test/broker/02-subpub-qos0.py | HowJMay/simple-tangle-accelerator | d79bfda23a0fcf67d5a7f9e66f02efa3e73ba381 | [
"MIT"
] | 1 | 2021-05-04T16:09:27.000Z | 2021-05-04T16:09:27.000Z | #!/usr/bin/env python3
# Test whether a client subscribed to a topic receives its own message sent to that topic.
from mosq_test_helper import *
rc = 1
mid = 53
keepalive = 60
connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive)
connack_packet = mosq_test.gen_connack(rc=0)
subscribe_packe... | 26.74359 | 93 | 0.74209 |
from mosq_test_helper import *
rc = 1
mid = 53
keepalive = 60
connect_packet = mosq_test.gen_connect("subpub-qos0-test", keepalive=keepalive)
connack_packet = mosq_test.gen_connack(rc=0)
subscribe_packet = mosq_test.gen_subscribe(mid, "subpub/qos0", 0)
suback_packet = mosq_test.gen_suback(mid, 0)
publish_packet ... | true | true |
1c42dc2b919e1e96da2ac976df6330be3dea9190 | 775 | py | Python | django_q/migrations/0007_ormq.py | Balletie/django-q | 03abbc960f8c35d0c4206c60ad01f08085539609 | [
"MIT"
] | null | null | null | django_q/migrations/0007_ormq.py | Balletie/django-q | 03abbc960f8c35d0c4206c60ad01f08085539609 | [
"MIT"
] | null | null | null | django_q/migrations/0007_ormq.py | Balletie/django-q | 03abbc960f8c35d0c4206c60ad01f08085539609 | [
"MIT"
] | 2 | 2020-11-10T01:14:24.000Z | 2021-06-11T12:50:19.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('django_q', '0006_auto_20150805_1817'),
]
operations = [
migrations.CreateModel(
name='OrmQ',
fields=... | 27.678571 | 114 | 0.541935 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('django_q', '0006_auto_20150805_1817'),
]
operations = [
migrations.CreateModel(
name='OrmQ',
fields=[
('id'... | true | true |
1c42ddcd3886317cd61f04751a3f3f161a5a9dda | 392 | py | Python | fragroutepluspy/modules/mod_echo.py | CreatePhotonW/fragroutepluspy | a00ae3aeb4bbd2c6adaad29b32ae8b496dac6203 | [
"MIT"
] | 1 | 2021-01-29T13:27:16.000Z | 2021-01-29T13:27:16.000Z | fragroutepluspy/modules/mod_echo.py | CreatePhotonW/fragroutepluspy | a00ae3aeb4bbd2c6adaad29b32ae8b496dac6203 | [
"MIT"
] | null | null | null | fragroutepluspy/modules/mod_echo.py | CreatePhotonW/fragroutepluspy | a00ae3aeb4bbd2c6adaad29b32ae8b496dac6203 | [
"MIT"
] | 1 | 2021-01-28T16:34:39.000Z | 2021-01-28T16:34:39.000Z | from .mod import Mod
class Echo(Mod):
name = "echo"
usage = "echo <string> ..."
description = """Echo the string argument(s) to standard output."""
def parse_args(self, args):
self.message = None
if len(args) < 1:
raise Mod.ArgumentException(self)
self.message = " ... | 23.058824 | 71 | 0.584184 | from .mod import Mod
class Echo(Mod):
name = "echo"
usage = "echo <string> ..."
description = """Echo the string argument(s) to standard output."""
def parse_args(self, args):
self.message = None
if len(args) < 1:
raise Mod.ArgumentException(self)
self.message = " ... | true | true |
1c42df1abd266d6b760f81e1219aaabbc3e40b0f | 20,727 | py | Python | userbot/modules/stickers.py | ryzxzn/Man-Userbot | e7d15c073e5c7d536205b36b6e975b294ed4a8c7 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/stickers.py | ryzxzn/Man-Userbot | e7d15c073e5c7d536205b36b6e975b294ed4a8c7 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/stickers.py | ryzxzn/Man-Userbot | e7d15c073e5c7d536205b36b6e975b294ed4a8c7 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
# Recode by @mrismanaziz
# FROM Man-Userbot <https://github.com/mrismanaziz/Man-Userbot>
# t.me/SharingUserbot & t.me/L... | 41.043564 | 129 | 0.569595 |
import asyncio
import io
import math
import random
import urllib.request
from os import remove
from PIL import Image
from telethon import events
from telethon.errors.rpcerrorlist import YouBlockedUserError
from telethon.tl.functions.messages import GetStickerSetRequest
from telethon.tl.types import (
Docu... | true | true |
1c42dfc738ba57702806720d9a8f918f90f70b8b | 8,504 | py | Python | ports/esp32/modules/sdcard.py | buginventor/lv_micropython | bf62dfc78497d47ced3b0931a270e553d4d2552b | [
"MIT"
] | 150 | 2020-05-24T17:42:24.000Z | 2022-03-28T12:47:53.000Z | ports/esp32/modules/sdcard.py | buginventor/lv_micropython | bf62dfc78497d47ced3b0931a270e553d4d2552b | [
"MIT"
] | 24 | 2020-05-19T10:46:39.000Z | 2022-01-25T22:47:44.000Z | ports/esp32/modules/sdcard.py | buginventor/lv_micropython | bf62dfc78497d47ced3b0931a270e553d4d2552b | [
"MIT"
] | 81 | 2020-05-19T03:57:34.000Z | 2022-03-18T03:34:08.000Z | """
MicroPython driver for SD cards using SPI bus.
Requires an SPI bus and a CS pin. Provides readblocks and writeblocks
methods so the device can be mounted as a filesystem.
Example usage on pyboard:
import pyb, sdcard, os
sd = sdcard.SDCard(pyb.SPI(1), pyb.Pin.board.X5)
pyb.mount(sd, '/sd2')
os.li... | 30.480287 | 77 | 0.52587 |
from micropython import const
import time
_CMD_TIMEOUT = const(100)
_R1_IDLE_STATE = const(1 << 0)
_R1_ILLEGAL_COMMAND = const(1 << 2)
_TOKEN_CMD25 = const(0xfc)
_TOKEN_STOP_TRAN = const(0xfd)
_TOKEN_DATA = const(0xfe)
class SDCard:
def __init__(self, spi, cs):
self.spi = spi
self.cs = cs... | true | true |
1c42dff8e71bfcd2130ff71be639cdd2ea134e7e | 8,155 | py | Python | metasv/extract_pairs.py | willrockout/metasv | b46f15cbe8a28941661855da6587451c971dc2e3 | [
"BSD-2-Clause"
] | 43 | 2015-01-12T20:58:24.000Z | 2021-11-24T07:30:06.000Z | metasv/extract_pairs.py | willrockout/metasv | b46f15cbe8a28941661855da6587451c971dc2e3 | [
"BSD-2-Clause"
] | 80 | 2015-01-08T00:34:55.000Z | 2022-02-16T08:30:34.000Z | metasv/extract_pairs.py | willrockout/metasv | b46f15cbe8a28941661855da6587451c971dc2e3 | [
"BSD-2-Clause"
] | 25 | 2015-04-30T06:30:28.000Z | 2022-02-22T02:48:20.000Z | import argparse
import logging
import multiprocessing
import time
from functools import partial, update_wrapper
from defaults import EXTRACTION_MAX_READ_PAIRS, EXTRACTION_MAX_NM, EXTRACTION_MAX_INTERVAL_TRUNCATION, EXTRACTION_TRUNCATION_PAD
import pysam
compl_table = [chr(i) for i in xrange(256)]
compl_table[ord('A')... | 42.473958 | 179 | 0.675659 | import argparse
import logging
import multiprocessing
import time
from functools import partial, update_wrapper
from defaults import EXTRACTION_MAX_READ_PAIRS, EXTRACTION_MAX_NM, EXTRACTION_MAX_INTERVAL_TRUNCATION, EXTRACTION_TRUNCATION_PAD
import pysam
compl_table = [chr(i) for i in xrange(256)]
compl_table[ord('A')... | true | true |
1c42e032f0792d13a5bee37f78155fb80de52228 | 29,706 | py | Python | external-deps/spyder-kernels/spyder_kernels/console/kernel.py | fumitoh/spyder | 12294fec88a2f61c756538ac38bd748d8e7b3f82 | [
"MIT"
] | 1 | 2021-07-08T01:27:25.000Z | 2021-07-08T01:27:25.000Z | external-deps/spyder-kernels/spyder_kernels/console/kernel.py | fumitoh/spyder | 12294fec88a2f61c756538ac38bd748d8e7b3f82 | [
"MIT"
] | null | null | null | external-deps/spyder-kernels/spyder_kernels/console/kernel.py | fumitoh/spyder | 12294fec88a2f61c756538ac38bd748d8e7b3f82 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2009- Spyder Kernels Contributors
#
# Licensed under the terms of the MIT License
# (see spyder_kernels/__init__.py for details)
# ---------------------------------------------------------------------... | 34.948235 | 79 | 0.592709 |
from distutils.version import LooseVersion
import os
import sys
import threading
import ipykernel
from ipykernel.ipkernel import IPythonKernel
from ipykernel.zmqshell import ZMQInteractiveShell
from traitlets.config.loader import LazyConfigValue
from spyder_kernels.py3compat import TEXT_TYPES, to_text_str... | true | true |
1c42e0a1df21fe60ca643c0cad463bce9b6f6e71 | 1,829 | py | Python | IEDC_Classification_fill/IEDC_Prototype_Classification_Extract.py | IndEcol/IE_data_commons | 93bca19c7b447aa9e7ba777dc10df9d09eaf1a05 | [
"MIT"
] | 13 | 2018-07-11T08:21:16.000Z | 2022-03-25T13:40:08.000Z | IEDC_Classification_fill/IEDC_Prototype_Classification_Extract.py | IndEcol/IE_data_commons | 93bca19c7b447aa9e7ba777dc10df9d09eaf1a05 | [
"MIT"
] | 23 | 2018-06-22T12:35:50.000Z | 2021-08-03T17:23:13.000Z | IEDC_Classification_fill/IEDC_Prototype_Classification_Extract.py | IndEcol/IE_data_commons | 93bca19c7b447aa9e7ba777dc10df9d09eaf1a05 | [
"MIT"
] | 2 | 2018-09-12T07:17:49.000Z | 2019-06-14T15:12:22.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 30 16:57:29 2017
@author: spauliuk
This script extract a given classification to Excel.
"""
import pymysql
import datetime
import numpy as np
from os import walk, path
import xlrd, xlwt
from datetime import date, timedelta
import csv
import IEDC_PW
import IEDC_Paths
... | 29.983607 | 335 | 0.74959 |
"""
Created on Thu Nov 30 16:57:29 2017
@author: spauliuk
This script extract a given classification to Excel.
"""
import pymysql
import datetime
import numpy as np
from os import walk, path
import xlrd, xlwt
from datetime import date, timedelta
import csv
import IEDC_PW
import IEDC_Paths
ClassNo = 2
conn ... | false | true |
1c42e0fb6c6a8804f139a55a6b4ef4187901c5b6 | 11,946 | py | Python | rangeslicetools/utils.py | KOLANICH/rangeslicetools | 3111219b6ee52556483e5e6e260ba769b14e818b | [
"Unlicense"
] | null | null | null | rangeslicetools/utils.py | KOLANICH/rangeslicetools | 3111219b6ee52556483e5e6e260ba769b14e818b | [
"Unlicense"
] | null | null | null | rangeslicetools/utils.py | KOLANICH/rangeslicetools | 3111219b6ee52556483e5e6e260ba769b14e818b | [
"Unlicense"
] | null | null | null | import heapq
import itertools
import typing
from collections.abc import Sequence
from functools import wraps
__all__ = ("SliceRangeT", "SliceRangeTypeT", "SliceRangeSeqT", "SliceRangeListT", "sAny2Type", "range2slice", "slice2range", "slen", "sdir", "svec", "srev", "sdirect", "snormalize", "ssplit_1_", "ssplit_1", "ss... | 28.375297 | 399 | 0.720827 | import heapq
import itertools
import typing
from collections.abc import Sequence
from functools import wraps
__all__ = ("SliceRangeT", "SliceRangeTypeT", "SliceRangeSeqT", "SliceRangeListT", "sAny2Type", "range2slice", "slice2range", "slen", "sdir", "svec", "srev", "sdirect", "snormalize", "ssplit_1_", "ssplit_1", "ss... | true | true |
1c42e161b3810277a30977eea2901c24884b60c8 | 357 | py | Python | source/appModules/skype.py | marlon-sousa/nvda | 83738d7d9150fb379083eb3918e9c78c78610489 | [
"bzip2-1.0.6"
] | 1,592 | 2015-11-10T12:05:44.000Z | 2022-03-31T11:50:40.000Z | source/appModules/skype.py | marlon-sousa/nvda | 83738d7d9150fb379083eb3918e9c78c78610489 | [
"bzip2-1.0.6"
] | 9,479 | 2015-11-10T20:56:48.000Z | 2022-03-31T23:51:30.000Z | source/appModules/skype.py | marlon-sousa/nvda | 83738d7d9150fb379083eb3918e9c78c78610489 | [
"bzip2-1.0.6"
] | 682 | 2015-11-10T11:19:23.000Z | 2022-03-31T07:51:29.000Z | # -*- coding: UTF-8 -*-
#appModules/skype.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2019 Peter Vágner, NV Access Limited, Babbage B.V.
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
import appModuleHandler
class AppModule(appModuleHandler.AppModule)... | 29.75 | 65 | 0.773109 |
import appModuleHandler
class AppModule(appModuleHandler.AppModule):
disableBrowseModeByDefault = True
| true | true |
1c42e2702c5774cffa7414e952498a588522c4de | 30,790 | bzl | Python | packages/bazel/src/ng_module.bzl | jameskirsch/angular | 168abc6d6f52713383411b14980e104c99bfeef5 | [
"MIT"
] | 1 | 2019-11-29T04:18:04.000Z | 2019-11-29T04:18:04.000Z | packages/bazel/src/ng_module.bzl | resuta566/angular | 5de7960f019701e4e26dc6a7809c244ef94b5e30 | [
"MIT"
] | null | null | null | packages/bazel/src/ng_module.bzl | resuta566/angular | 5de7960f019701e4e26dc6a7809c244ef94b5e30 | [
"MIT"
] | null | null | null | # Copyright Google Inc. All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license
"""Run Angular's AOT template compiler
"""
load(
":external.bzl",
"COMMON_ATTRIBUTES",
"COMMON_OUTPUTS",
"DEFAULT_API_EXTRAC... | 38.778338 | 161 | 0.66317 |
load(
":external.bzl",
"COMMON_ATTRIBUTES",
"COMMON_OUTPUTS",
"DEFAULT_API_EXTRACTOR",
"DEFAULT_NG_COMPILER",
"DEFAULT_NG_XI18N",
"DEPS_ASPECTS",
"NpmPackageInfo",
"TsConfigInfo",
"compile_ts",
"js_ecma_script_module_info",
"js_named_module_info",
"node_modules_a... | true | true |
1c42e27db63ee9fece775495e0835c19ee035ba6 | 684 | py | Python | dashboard/migrations/0026_auto_20200903_1538.py | HERA-Team/heranow | 1bc827459a7a92f600cefbd0c8a08f629a211cda | [
"BSD-3-Clause"
] | null | null | null | dashboard/migrations/0026_auto_20200903_1538.py | HERA-Team/heranow | 1bc827459a7a92f600cefbd0c8a08f629a211cda | [
"BSD-3-Clause"
] | 6 | 2020-09-10T05:33:17.000Z | 2021-03-16T20:36:47.000Z | dashboard/migrations/0026_auto_20200903_1538.py | HERA-Team/heranow | 1bc827459a7a92f600cefbd0c8a08f629a211cda | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.0.3 on 2020-09-03 15:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("dashboard", "0025_auto_20200902_2049"),
]
operations = [
migrations.AlterModelOptions(
name="snaptoant", options={"ordering": ["... | 25.333333 | 69 | 0.573099 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("dashboard", "0025_auto_20200902_2049"),
]
operations = [
migrations.AlterModelOptions(
name="snaptoant", options={"ordering": ["node", "snap"]},
),
migrations.... | true | true |
1c42e35407c661a4aa593a0690413cb4d041d6eb | 1,639 | py | Python | tetrad_cms/config/local.py | UsernameForGerman/tetraD-NK | e00b406ac7b2ce63b92698c887fb53bf53344454 | [
"Apache-2.0"
] | null | null | null | tetrad_cms/config/local.py | UsernameForGerman/tetraD-NK | e00b406ac7b2ce63b92698c887fb53bf53344454 | [
"Apache-2.0"
] | null | null | null | tetrad_cms/config/local.py | UsernameForGerman/tetraD-NK | e00b406ac7b2ce63b92698c887fb53bf53344454 | [
"Apache-2.0"
] | null | null | null | from .base import *
# GENERAL
# ------------------------------------------------------------------------------
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', ' ').split(' ')
# REST FRAMEWORK
# ------------------------------------------------------------------------------
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CL... | 28.754386 | 94 | 0.568029 | from .base import *
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', ' ').split(' ')
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.AllowAny', ),
'DEFAULT_AUTHENTICATION_CLASSES': ('rest_framework.authentication.TokenAuthentication', ),
'DEFAULT_PARSER_CLASSES': (
... | true | true |
1c42e373479814ddbda206be88d0715f6ab20dc6 | 4,817 | py | Python | scripts/github-actions/filter_sarif.py | aerkiaga/avogadrolibs | f0a64061f521dce156e67e07118db546da6b9f1b | [
"BSD-3-Clause"
] | null | null | null | scripts/github-actions/filter_sarif.py | aerkiaga/avogadrolibs | f0a64061f521dce156e67e07118db546da6b9f1b | [
"BSD-3-Clause"
] | null | null | null | scripts/github-actions/filter_sarif.py | aerkiaga/avogadrolibs | f0a64061f521dce156e67e07118db546da6b9f1b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# From https://github.com/zbazztian/filter-sarif/blob/master/filter_sarif.py
# Some modifications by Geoffrey Hutchison
import argparse
import json
import re
from globber import match
def match_path_and_rule(path, rule, patterns):
result = True
for sign, file_pat... | 33.451389 | 99 | 0.542246 |
import argparse
import json
import re
from globber import match
def match_path_and_rule(path, rule, patterns):
result = True
for sign, file_pattern, rule_pattern in patterns:
if match(rule_pattern, rule) and match(file_pattern, path):
result = sign
return result
def parse_patter... | true | true |
1c42e427a00c05ad31c186816aafb28c013df29c | 7,088 | py | Python | homeassistant/components/lock/wink.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | 37 | 2018-05-22T07:17:26.000Z | 2022-03-03T13:14:46.000Z | homeassistant/components/lock/wink.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | 34 | 2018-05-22T07:19:40.000Z | 2022-03-11T23:21:03.000Z | homeassistant/components/lock/wink.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | 8 | 2018-05-30T20:05:26.000Z | 2021-02-19T14:17:05.000Z | """
Support for Wink locks.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/lock.wink/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.components.lock import LockDevice
from homeassistant.components.wink import DOMAIN, Wink... | 33.433962 | 78 | 0.643905 | import asyncio
import logging
import voluptuous as vol
from homeassistant.components.lock import LockDevice
from homeassistant.components.wink import DOMAIN, WinkDevice
from homeassistant.const import (
ATTR_CODE, ATTR_ENTITY_ID, ATTR_NAME, STATE_UNKNOWN)
import homeassistant.helpers.config_validation as cv
DEPE... | true | true |
1c42e5438572fb044589dd487d08721a41242e32 | 2,155 | py | Python | src/azure-cli/azure/cli/command_modules/interactive/__init__.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 3,287 | 2016-07-26T17:34:33.000Z | 2022-03-31T09:52:13.000Z | src/azure-cli/azure/cli/command_modules/interactive/__init__.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 19,206 | 2016-07-26T07:04:42.000Z | 2022-03-31T23:57:09.000Z | src/azure-cli/azure/cli/command_modules/interactive/__init__.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 2,575 | 2016-07-26T06:44:40.000Z | 2022-03-31T22:56:06.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 43.979592 | 123 | 0.589327 |
from knack.help_files import helps
from azure.cli.core import AzCommandsLoader
helps['interactive'] = """
type: command
short-summary: Start interactive mode. Installs the Interactive extension if not installed already.
long-summary: >
For more information on ... | true | true |
1c42e633061f9e6448acc5fe0b62e464a3e38089 | 645 | py | Python | models.py | dholzmueller/bmdal_reg | 1a9e9c19fbd350ec32a2bd7b505e7015df7dc9bf | [
"Apache-2.0"
] | 3 | 2022-03-19T21:30:10.000Z | 2022-03-30T08:20:48.000Z | models.py | dholzmueller/bmdal_reg | 1a9e9c19fbd350ec32a2bd7b505e7015df7dc9bf | [
"Apache-2.0"
] | null | null | null | models.py | dholzmueller/bmdal_reg | 1a9e9c19fbd350ec32a2bd7b505e7015df7dc9bf | [
"Apache-2.0"
] | null | null | null | from layers import *
def create_tabular_model(n_models, n_features, hidden_sizes=[512]*2, act='relu', **config):
layer_sizes = [n_features] + hidden_sizes + [1]
layers = []
for in_features, out_features in zip(layer_sizes[:-2], layer_sizes[1:-1]):
layers.append(ParallelLinearLayer(n_models, in_fea... | 46.071429 | 119 | 0.68062 | from layers import *
def create_tabular_model(n_models, n_features, hidden_sizes=[512]*2, act='relu', **config):
layer_sizes = [n_features] + hidden_sizes + [1]
layers = []
for in_features, out_features in zip(layer_sizes[:-2], layer_sizes[1:-1]):
layers.append(ParallelLinearLayer(n_models, in_fea... | true | true |
1c42e886e3522fe82b8d2736f2b6fc0f4b73f2cb | 1,052 | py | Python | swing_open_loop.py | HuiminHe/PyDy | 0834605bc2eed8d2768b50f55162bd6ac09cc694 | [
"MIT"
] | null | null | null | swing_open_loop.py | HuiminHe/PyDy | 0834605bc2eed8d2768b50f55162bd6ac09cc694 | [
"MIT"
] | null | null | null | swing_open_loop.py | HuiminHe/PyDy | 0834605bc2eed8d2768b50f55162bd6ac09cc694 | [
"MIT"
] | null | null | null | from scipy.integrate import odeint
from swing_config import *
f = cloudpickle.load(open('./swing_open_loop_dynamic.dll', 'rb'))
def fv_gen(amp, ome, phi, q_max):
return lambda t, y: amp * np.sin(ome * t + phi) / (1 + np.exp((np.abs(y[1:3])-q_max) / 0.01) * np.logical_or(np.abs(y[1:3]) < q_max, y[1:3] * y[4:] > 0)... | 30.057143 | 157 | 0.606464 | from scipy.integrate import odeint
from swing_config import *
f = cloudpickle.load(open('./swing_open_loop_dynamic.dll', 'rb'))
def fv_gen(amp, ome, phi, q_max):
return lambda t, y: amp * np.sin(ome * t + phi) / (1 + np.exp((np.abs(y[1:3])-q_max) / 0.01) * np.logical_or(np.abs(y[1:3]) < q_max, y[1:3] * y[4:] > 0)... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.