hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
097f7bfba7422e5da24b2738dbe0ce7285903ec7 | 197 | py | Python | Sets/Set .add().py | akshat-jjain/HackerRank-Python-Solutions | 85e344573476795f43b09cf04c3f6956c643da16 | [
"MIT"
] | 2 | 2021-05-19T11:59:57.000Z | 2021-08-23T14:21:49.000Z | Sets/Set .add().py | akshat-jjain/HackerRank-Python-Solutions | 85e344573476795f43b09cf04c3f6956c643da16 | [
"MIT"
] | null | null | null | Sets/Set .add().py | akshat-jjain/HackerRank-Python-Solutions | 85e344573476795f43b09cf04c3f6956c643da16 | [
"MIT"
] | 1 | 2021-05-19T12:02:16.000Z | 2021-05-19T12:02:16.000Z | # Enter your code here. Read input from STDIN. Print output to STDOUT
n=int(input())
strarr=[]
for x in range(n):
strin=input()
strarr.append(strin)
stradd=set(strarr)
print(len(stradd))
| 17.909091 | 69 | 0.695431 |
ad3582b44dcd960494cc091235737b927f1ea699 | 7,115 | py | Python | modules/puzzle/position_list.py | karol-brejna-i/pgn-tactics-generator | 572682a82da261be326a2665182a402e6194a988 | [
"MIT"
] | null | null | null | modules/puzzle/position_list.py | karol-brejna-i/pgn-tactics-generator | 572682a82da261be326a2665182a402e6194a988 | [
"MIT"
] | null | null | null | modules/puzzle/position_list.py | karol-brejna-i/pgn-tactics-generator | 572682a82da261be326a2665182a402e6194a988 | [
"MIT"
] | null | null | null | import logging
from operator import methodcaller
import chess
import chess.uci
from modules.bcolors.bcolors import bcolors
from modules.puzzle.analysed import analysed
class position_list:
def __init__(self, position, engine, info_handler, player_turn=True, best_move=None, evaluation=None, strict=True):
... | 46.201299 | 119 | 0.57428 |
c674fb66f756f25d9a4105df7bb2cd0300d51955 | 8,418 | py | Python | src/sage/groups/additive_abelian/qmodnz_element.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2016-06-19T14:48:31.000Z | 2022-01-28T08:46:01.000Z | src/sage/groups/additive_abelian/qmodnz_element.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/groups/additive_abelian/qmodnz_element.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 7 | 2021-11-08T10:01:59.000Z | 2022-03-03T11:25:52.000Z | r"""
Elements of `\Q/n\Z`.
EXAMPLES::
sage: A = QQ / (3*ZZ)
sage: x = A(11/3); x
2/3
sage: x*14
1/3
sage: x.additive_order()
9
sage: x / 3
2/9
"""
#*****************************************************************************
# Copyright (C) 2017 David Roe <roed.math@gmail.c... | 24.051429 | 85 | 0.442029 |
2fa0928b7e2e8b0480f8edeb01b20e89fdd5fc57 | 6,878 | py | Python | version.py | BaldLee/tvm | b53472c7b6afa34260afeffc5f088591352c58c3 | [
"Apache-2.0"
] | 90 | 2019-01-26T00:38:49.000Z | 2022-03-11T23:12:34.000Z | version.py | BaldLee/tvm | b53472c7b6afa34260afeffc5f088591352c58c3 | [
"Apache-2.0"
] | 91 | 2019-02-27T00:17:01.000Z | 2022-02-21T18:08:21.000Z | version.py | BaldLee/tvm | b53472c7b6afa34260afeffc5f088591352c58c3 | [
"Apache-2.0"
] | 41 | 2019-01-28T14:37:03.000Z | 2022-03-31T03:58:57.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.990698 | 99 | 0.625473 |
72792282b48769c9bb1ee05f6671ad48a05cfbb6 | 439 | py | Python | tests/pyre/framework/linker.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | 3 | 2019-08-02T21:02:47.000Z | 2021-09-08T13:59:43.000Z | tests/pyre/framework/linker.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | tests/pyre/framework/linker.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
"""
Verify the linker is accessible through the executive
"""
def test():
import pyre
# build the executive
executive = pyre.executive
# access the linker
assert executive.... | 13.30303 | 53 | 0.642369 |
3cd91ca88feed51b58f6bbf439ac07076cd25bbf | 251 | py | Python | corehq/apps/app_manager/current_builds.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | 1 | 2015-02-10T23:26:39.000Z | 2015-02-10T23:26:39.000Z | corehq/apps/app_manager/current_builds.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | 1 | 2022-03-12T01:03:25.000Z | 2022-03-12T01:03:25.000Z | corehq/apps/app_manager/current_builds.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | DEFAULT_TAG = "1.1"
PREVIEW_TAG = "1.2"
MENU_OPTIONS= [
{"label": "CommCare 1.1 (recommended)", "tag": "1.1"},
{"label": "CommCare 1.2 (bleeding edge)", "tag": "1.2"},
]
TAG_MAP = {
"1.1": ("1.1.1", 9010),
"1.2": ("1.2.dev", 7106),
} | 20.916667 | 60 | 0.50996 |
e3b296da0ab67f84b6d787b7b0d8a554aede3458 | 16,111 | py | Python | lib/py/bitprotolib/bp.py | solarcaratuva/bitproto | 4f7679a23ce3eeb16e7464ae348c8a3aff921542 | [
"BSD-3-Clause"
] | null | null | null | lib/py/bitprotolib/bp.py | solarcaratuva/bitproto | 4f7679a23ce3eeb16e7464ae348c8a3aff921542 | [
"BSD-3-Clause"
] | null | null | null | lib/py/bitprotolib/bp.py | solarcaratuva/bitproto | 4f7679a23ce3eeb16e7464ae348c8a3aff921542 | [
"BSD-3-Clause"
] | null | null | null | """
bitprotolib.bp
~~~~~~~~~~~~~~
Encoding support for generated python files.
Keep it simple: No magic.
"""
import json
from abc import abstractmethod
from contextlib import contextmanager
from dataclasses import asdict, dataclass
from dataclasses import field as dataclass_field
from typing import Any, Dict, Itera... | 30.571157 | 90 | 0.64608 |
39894e49d2cce900d515ca9170b93b224692cfc9 | 35,534 | py | Python | pkgs/robot-pkg/src/genie/libs/robot/GenieRobot.py | wilbeacham85/genielibs | 519da71e3956b86d4211d8649667c0d931dd2715 | [
"Apache-2.0"
] | null | null | null | pkgs/robot-pkg/src/genie/libs/robot/GenieRobot.py | wilbeacham85/genielibs | 519da71e3956b86d4211d8649667c0d931dd2715 | [
"Apache-2.0"
] | null | null | null | pkgs/robot-pkg/src/genie/libs/robot/GenieRobot.py | wilbeacham85/genielibs | 519da71e3956b86d4211d8649667c0d931dd2715 | [
"Apache-2.0"
] | null | null | null | import re
import os
import yaml
import inspect
import logging
import importlib
from collections import ChainMap
from copy import deepcopy
from collections import namedtuple
from robot.api.deco import keyword
from robot.libraries.BuiltIn import BuiltIn, RobotNotRunningError
from genie.abstract import Lookup
from pyat... | 42.101896 | 240 | 0.538723 |
2f0701301acb35e4ccaf7c51b4cda3bd4690a905 | 1,105 | py | Python | client/client/my_client.py | danieljeswin/ros2_basics | 79101fdff7ebf627baeb0331d2c62408a5559701 | [
"MIT"
] | null | null | null | client/client/my_client.py | danieljeswin/ros2_basics | 79101fdff7ebf627baeb0331d2c62408a5559701 | [
"MIT"
] | null | null | null | client/client/my_client.py | danieljeswin/ros2_basics | 79101fdff7ebf627baeb0331d2c62408a5559701 | [
"MIT"
] | null | null | null | import rclpy
from rclpy.node import Node
from my_service.srv import Add
import random
class Client(Node):
def __init__(self):
super().__init__('client')
self.client = self.create_client(Add, 'add_floats')
self.request = Add.Request()
while not self.client.wait_for_service(timeout_se... | 31.571429 | 130 | 0.636199 |
cf49221ea56ca3480d519b47f1f6d826592b3ca3 | 1,105 | py | Python | docs/forms.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | docs/forms.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | docs/forms.py | ruslan-ok/ruslan | fc402e53d2683581e13f4d6c69a6f21e5c2ca1f8 | [
"MIT"
] | null | null | null | from django import forms
from django.utils.translation import gettext_lazy as _
from rusel.base.forms import BaseCreateForm, BaseEditForm
from task.models import Task, Group
from task.const import ROLE_DOC
from docs.config import app_config
from rusel.base.forms import GroupForm
role = ROLE_DOC
#--------------------... | 26.309524 | 69 | 0.568326 |
731c4a0ee9e69d0a084bc4a55974f4cac893222c | 5,898 | py | Python | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711211426.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711211426.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/ScopesClosuresAndDecorators/Closures_20210711211426.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Closuers
Free variables and closures
Remember: Functions defined inside another function can access the outer (nonLocal) variables
"""
def outer():
x = 'python'
/ this x refers to the one in outer's scope', this nonlocal variable x is called a free varia... | 28.355769 | 132 | 0.561546 |
152a70261b183885f1def37e04df8fda5d194b06 | 9,089 | py | Python | src/datadog_api_client/v1/model/toplist_widget_request.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | src/datadog_api_client/v1/model/toplist_widget_request.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | src/datadog_api_client/v1/model/toplist_widget_request.py | MichaelTROEHLER/datadog-api-client-python | 12c46626622fb1277bb1e172753b342c671348bd | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
import re # noqa: F401
import sys # noqa: F401
import nulltype # ... | 44.121359 | 115 | 0.611508 |
e98cb58a0ada6308ea1bbfff5956713e8403ffda | 6,339 | py | Python | synergetic_molecule_generator/crossover.py | VasaKiDD/end-to-end-drug-discovery | 355665940d3f5a30569bac295a177dfb5b54bd13 | [
"Apache-2.0"
] | null | null | null | synergetic_molecule_generator/crossover.py | VasaKiDD/end-to-end-drug-discovery | 355665940d3f5a30569bac295a177dfb5b54bd13 | [
"Apache-2.0"
] | 1 | 2020-04-23T11:10:39.000Z | 2020-04-23T11:10:39.000Z | synergetic_molecule_generator/crossover.py | VasaKiDD/end-to-end-drug-discovery | 355665940d3f5a30569bac295a177dfb5b54bd13 | [
"Apache-2.0"
] | null | null | null | """
Written by Jan H. Jensen 2018
"""
import random
import numpy as np
from rdkit import Chem
from rdkit import rdBase
from rdkit.Chem import AllChem
rdBase.DisableLog("rdApp.error")
average_size = 39.15
size_stdev = 3.50
def cut(mol):
if not mol.HasSubstructMatch(Chem.MolFromSmarts("[*]-;!@[*]")):
ret... | 31.073529 | 99 | 0.578167 |
a3c39041adf03290f2d26949d6013a9e9d4f42a2 | 2,587 | py | Python | plata/default_settings.py | allink/plata | dc81b446a188accdf6459d80c4634fdeeede191b | [
"BSD-3-Clause"
] | null | null | null | plata/default_settings.py | allink/plata | dc81b446a188accdf6459d80c4634fdeeede191b | [
"BSD-3-Clause"
] | null | null | null | plata/default_settings.py | allink/plata | dc81b446a188accdf6459d80c4634fdeeede191b | [
"BSD-3-Clause"
] | null | null | null | from decimal import Decimal
from django.conf import settings
#: Are prices shown with tax included or not? (Defaults to ``True``)
#: Please note that this setting is purely presentational and has no
#: influence on the values stored in the database.
PLATA_PRICE_INCLUDES_TAX = getattr(settings, 'PLATA_PRICE_INCLUDES_T... | 37.492754 | 82 | 0.753769 |
91ba1b4eed5274f7b23421c13802281f302a7e09 | 1,293 | py | Python | openstates/metadata/data/wy.py | washabstract/openstates-core | ea69564f1f56fe4a80181b0aa715731bbc47e3f5 | [
"MIT"
] | 9 | 2020-04-04T00:19:07.000Z | 2022-02-27T02:24:12.000Z | openstates/metadata/data/wy.py | washabstract/openstates-core | ea69564f1f56fe4a80181b0aa715731bbc47e3f5 | [
"MIT"
] | 17 | 2020-03-31T18:19:59.000Z | 2022-01-03T15:18:48.000Z | openstates/metadata/data/wy.py | washabstract/openstates-core | ea69564f1f56fe4a80181b0aa715731bbc47e3f5 | [
"MIT"
] | 19 | 2020-04-10T21:32:21.000Z | 2022-03-02T20:23:21.000Z | from ..models import State, Chamber, simple_numbered_districts
WY = State(
name="Wyoming",
abbr="WY",
capital="Cheyenne",
capital_tz="America/Denver",
fips="56",
unicameral=False,
legislature_name="Wyoming State Legislature",
legislature_organization_id="ocd-organization/b47d8d36-68d9-4... | 34.026316 | 88 | 0.666667 |
f4c28349facd7ae9ad01df8ed746d697ebbd945c | 248 | py | Python | admob/__init__.py | niavlys/admob4kivy | f79fb07e40ad7799526150ae8edc2fc5b1cb7db0 | [
"MIT"
] | 4 | 2017-02-24T23:51:46.000Z | 2021-04-11T11:24:23.000Z | admob/__init__.py | niavlys/admob4kivy | f79fb07e40ad7799526150ae8edc2fc5b1cb7db0 | [
"MIT"
] | 2 | 2017-08-11T05:05:30.000Z | 2019-11-13T13:56:51.000Z | admob/__init__.py | niavlys/admob4kivy | f79fb07e40ad7799526150ae8edc2fc5b1cb7db0 | [
"MIT"
] | 5 | 2017-02-24T22:48:09.000Z | 2020-11-20T13:54:26.000Z | from kivy import platform
__all__ = ('Admob',)
if platform == 'android':
from admob4android import AdmobAndroid as Admob
elif platform == 'ios':
from admob4ios import AdmobIos as Admob
else:
from admobmock import AdmobMock as Admob
| 19.076923 | 51 | 0.729839 |
fca78240ac3ce6527f404b8c6b12791a339766ff | 4,944 | py | Python | build/lib/torchstat/compute_madd.py | shiqiuwang/Hardness_aware_Sample_Distillation | b70823e9e180ed61a02e1eb73bbe9a3c2897050f | [
"Apache-2.0",
"MIT"
] | 1,237 | 2018-10-27T15:52:19.000Z | 2022-03-30T03:25:06.000Z | build/lib/torchstat/compute_madd.py | shiqiuwang/Hardness_aware_Sample_Distillation | b70823e9e180ed61a02e1eb73bbe9a3c2897050f | [
"Apache-2.0",
"MIT"
] | 36 | 2018-10-30T09:16:24.000Z | 2022-03-28T06:53:20.000Z | build/lib/torchstat/compute_madd.py | shiqiuwang/Hardness_aware_Sample_Distillation | b70823e9e180ed61a02e1eb73bbe9a3c2897050f | [
"Apache-2.0",
"MIT"
] | 132 | 2018-10-30T06:32:34.000Z | 2022-03-20T15:31:51.000Z | """
compute Multiply-Adds(MAdd) of each leaf module
"""
import torch.nn as nn
def compute_Conv2d_madd(module, inp, out):
assert isinstance(module, nn.Conv2d)
assert len(inp.size()) == 4 and len(inp.size()) == len(out.size())
in_c = inp.size()[1]
k_h, k_w = module.kernel_size
out_c, out_h, out_w ... | 30.518519 | 83 | 0.655542 |
37e01743cbdf94f3d3b9b5791bd5b680b7532582 | 3,999 | py | Python | contrib/normalize_triplet.py | rfourquet/julia | 18674303bdfb5670f3bd36dd0e6ba0e6cf2bcd8b | [
"Zlib"
] | 1 | 2020-09-02T06:38:45.000Z | 2020-09-02T06:38:45.000Z | contrib/normalize_triplet.py | rfourquet/julia | 18674303bdfb5670f3bd36dd0e6ba0e6cf2bcd8b | [
"Zlib"
] | null | null | null | contrib/normalize_triplet.py | rfourquet/julia | 18674303bdfb5670f3bd36dd0e6ba0e6cf2bcd8b | [
"Zlib"
] | null | null | null | #!/usr/bin/env python
import re, sys
# This script designed to mimick `src/PlatformNames.jl` in `BinaryProvider.jl`, which has
# a method `platform_key_abi()` to parse uname-like output into something standarized.
if len(sys.argv) < 2:
print("Usage: {} <host triplet> [<gcc version>] [<cxxabi11>]".format(sys.argv... | 28.978261 | 157 | 0.605401 |
102dc9dc04b2c84663864257cb6eacf7a2fdec93 | 5,602 | py | Python | feems/sim.py | karltayeb/feems | 2a8e7235465113b59dd45e248179abca53bb47b0 | [
"MIT"
] | 6 | 2021-05-21T11:00:32.000Z | 2022-02-09T00:08:45.000Z | feems/sim.py | karltayeb/feems | 2a8e7235465113b59dd45e248179abca53bb47b0 | [
"MIT"
] | 5 | 2021-07-07T01:34:48.000Z | 2022-01-20T11:28:07.000Z | feems/sim.py | karltayeb/feems | 2a8e7235465113b59dd45e248179abca53bb47b0 | [
"MIT"
] | 3 | 2021-05-12T03:00:20.000Z | 2021-06-16T16:28:25.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools as it
import networkx as nx
import numpy as np
import msprime
def setup_graph(
n_rows=8,
n_columns=12,
barrier_startpt=2.5,
barrier_endpt=8.5,
anisotropy_scaler=1.0,
b... | 27.596059 | 95 | 0.62317 |
6b0494f9f68807f4982f0c5a8bbde96831a87a88 | 769 | py | Python | setup.py | ebebbington/docker-environment-creator | c2b5be69d2ad4fae11f00935072afca927392538 | [
"MIT"
] | null | null | null | setup.py | ebebbington/docker-environment-creator | c2b5be69d2ad4fae11f00935072afca927392538 | [
"MIT"
] | 23 | 2020-02-27T20:13:39.000Z | 2021-01-24T16:34:12.000Z | setup.py | ebebbington/docker-environment-creator | c2b5be69d2ad4fae11f00935072afca927392538 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="denv-creator",
version="0.0.1",
author="Edward Bebbinngton",
author_email="EdwardSBebbington@hotmail.com",
description="Simple python script to create every file and configurations for mul... | 33.434783 | 111 | 0.685306 |
99cf33f467d7fca195e6ca076cdc514f17572ec8 | 755 | py | Python | Flow Diagram/generic-cms/generic-cms.py | albertchae/threat-model-cookbook | 74590ef6ebcafa97b12c19f03d671fafaa120d61 | [
"Apache-2.0"
] | 248 | 2018-06-08T13:14:47.000Z | 2022-03-24T09:35:04.000Z | Flow Diagram/generic-cms/generic-cms.py | albertchae/threat-model-cookbook | 74590ef6ebcafa97b12c19f03d671fafaa120d61 | [
"Apache-2.0"
] | 22 | 2018-06-08T13:10:28.000Z | 2021-10-15T03:42:39.000Z | Flow Diagram/generic-cms/generic-cms.py | albertchae/threat-model-cookbook | 74590ef6ebcafa97b12c19f03d671fafaa120d61 | [
"Apache-2.0"
] | 53 | 2018-06-10T17:04:45.000Z | 2022-03-29T22:04:19.000Z | from pytm.pytm import TM, Boundary, Server, Actor, Datastore, Dataflow, SetOfProcesses
tm = TM("Generic CMS example")
tm.description = "This is a sample threat model for the Threat Model Cookbook."
internet = Boundary("Internet")
user = Actor("Generic/Privilege User")
webserver = Server("Web Server")
webserver.inBo... | 27.962963 | 86 | 0.74702 |
48faf388c4be1e1581d5e3c4ac618efaf8c5e3f2 | 2,274 | py | Python | empower_core/projectsmanager/cataloghandler.py | 5g-empower/empower-core | 38eac8eebf57da4bec07518383ab65a5544445fe | [
"Apache-2.0"
] | 3 | 2020-05-15T01:31:24.000Z | 2020-07-05T04:13:33.000Z | empower_core/projectsmanager/cataloghandler.py | 5g-empower/empower-core | 38eac8eebf57da4bec07518383ab65a5544445fe | [
"Apache-2.0"
] | null | null | null | empower_core/projectsmanager/cataloghandler.py | 5g-empower/empower-core | 38eac8eebf57da4bec07518383ab65a5544445fe | [
"Apache-2.0"
] | 4 | 2020-05-29T10:16:37.000Z | 2021-07-06T10:48:02.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2020 Roberto Riggio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 33.940299 | 79 | 0.516711 |
eaf004dc4a4cce078f7a57460d5da098b8b18780 | 3,205 | py | Python | app/api/api_v1/endpoints/rolling_average_endpoint.py | wiki-yu/fastapi-algorithm-library | 8f745e9fe4d1d063dc8505d4c7f467e95209a385 | [
"MIT"
] | null | null | null | app/api/api_v1/endpoints/rolling_average_endpoint.py | wiki-yu/fastapi-algorithm-library | 8f745e9fe4d1d063dc8505d4c7f467e95209a385 | [
"MIT"
] | null | null | null | app/api/api_v1/endpoints/rolling_average_endpoint.py | wiki-yu/fastapi-algorithm-library | 8f745e9fe4d1d063dc8505d4c7f467e95209a385 | [
"MIT"
] | null | null | null | import os
import glob
from pathlib import Path
from typing import Any, Optional, List
import aiofiles
from fastapi import APIRouter, File, UploadFile, HTTPException, status
# from app import schemas
from app.api import deps
from app.libs.action_localization.rolling_average import Vgg_RollAverage_RealTime
router = AP... | 32.05 | 83 | 0.629329 |
7b06cc21cd46e7d9f1f4c3a1f974ec92020398fd | 2,241 | py | Python | Core Transforms/Side Input/Side Input/task.py | EllaDing/beam-katas-python | f4636d748ca6d10bb8b0cf7913f35bde3c7605cf | [
"Apache-2.0"
] | null | null | null | Core Transforms/Side Input/Side Input/task.py | EllaDing/beam-katas-python | f4636d748ca6d10bb8b0cf7913f35bde3c7605cf | [
"Apache-2.0"
] | null | null | null | Core Transforms/Side Input/Side Input/task.py | EllaDing/beam-katas-python | f4636d748ca6d10bb8b0cf7913f35bde3c7605cf | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 31.56338 | 81 | 0.688532 |
7fb77f3dd7fe1a1764b36488fb379297eef9fb3c | 13,298 | py | Python | intersight/model/workflow_target_property.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/workflow_target_property.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/workflow_target_property.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 49.070111 | 1,678 | 0.633028 |
0b8a2022c51249b6b5e72d2b916ce46a8282e79a | 4,384 | py | Python | import tkinter as tk.py | hadi1421/python | 1ef2f8f2f959024ae483f4abc81eb21d5c17c801 | [
"Apache-2.0"
] | null | null | null | import tkinter as tk.py | hadi1421/python | 1ef2f8f2f959024ae483f4abc81eb21d5c17c801 | [
"Apache-2.0"
] | null | null | null | import tkinter as tk.py | hadi1421/python | 1ef2f8f2f959024ae483f4abc81eb21d5c17c801 | [
"Apache-2.0"
] | null | null | null | # PyDataMath-II Calculator
import tkinter as tk
WHITE = "#F8F8F8" # black/white
TAN = "#F1EABC" # black/tan
var = {'front':[], 'back':[], 'decimal':False, 'x_val':0, 'y_val':0, 'result':0, 'operator':''}
root = tk.Tk()
root.title('PyDataMath-II')
root.config(bg='#272533')
display_text = tk.StringVar()
di... | 37.470085 | 175 | 0.600137 |
1ca6ebce2c954413ddd38318e8e3dabd4cb92f94 | 522 | py | Python | src/waldur_openstack/openstack_tenant/migrations/0021_instance_subnets.py | opennode/waldur-openstack | 8a4170c09bdb8367493441016ef06081250fddb8 | [
"MIT"
] | 1 | 2017-11-07T19:53:57.000Z | 2017-11-07T19:53:57.000Z | src/waldur_openstack/openstack_tenant/migrations/0021_instance_subnets.py | opennode/waldur-openstack | 8a4170c09bdb8367493441016ef06081250fddb8 | [
"MIT"
] | null | null | null | src/waldur_openstack/openstack_tenant/migrations/0021_instance_subnets.py | opennode/waldur-openstack | 8a4170c09bdb8367493441016ef06081250fddb8 | [
"MIT"
] | 3 | 2017-09-24T03:11:19.000Z | 2018-08-12T07:43:13.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-02-28 09:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('openstack_tenant', '0020_remove_external_ips'),
]
operations = [
migrations... | 24.857143 | 110 | 0.651341 |
56a04102db34c03bc66001ba8c7903191f21ed08 | 1,989 | py | Python | source/filter_double_quote.py | landml/ErrorLogging | 31c04db30900a3a35eccb6fe7167e40c3e048a87 | [
"MIT"
] | null | null | null | source/filter_double_quote.py | landml/ErrorLogging | 31c04db30900a3a35eccb6fe7167e40c3e048a87 | [
"MIT"
] | null | null | null | source/filter_double_quote.py | landml/ErrorLogging | 31c04db30900a3a35eccb6fe7167e40c3e048a87 | [
"MIT"
] | null | null | null | import re
import ast
from error_categories_EE2 import add_category
def filter_double(error_dictionary, error, regex_pat, sub_sym):
"""Filter double filters errors that are double quoted. This double quoted error can be "''", "()" or other"""
# First the other quotes are striped
error = error[1:-1].strip(... | 51 | 130 | 0.65812 |
9c61ca929361e288410218e8aabeaf28a9743b59 | 73,618 | py | Python | napalm/eos/eos.py | mattlan/napalm | 0137fdd2638099181043b49b84f0f75571a8db45 | [
"Apache-2.0"
] | null | null | null | napalm/eos/eos.py | mattlan/napalm | 0137fdd2638099181043b49b84f0f75571a8db45 | [
"Apache-2.0"
] | null | null | null | napalm/eos/eos.py | mattlan/napalm | 0137fdd2638099181043b49b84f0f75571a8db45 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Spotify AB. All rights reserved.
#
# The contents of this file are 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 requi... | 41.288839 | 147 | 0.516124 |
539559f97d5cf65c541d6d364a2de9c0086a128c | 3,605 | py | Python | marrow/mongo/core/field/date.py | marrow/mongo | 1a8e5fe9047b6a5bb2eaeea95f3dc085c737067f | [
"MIT"
] | 22 | 2016-03-22T05:32:26.000Z | 2021-06-19T06:23:47.000Z | marrow/mongo/core/field/date.py | marrow/mongo | 1a8e5fe9047b6a5bb2eaeea95f3dc085c737067f | [
"MIT"
] | 59 | 2016-02-19T22:21:33.000Z | 2022-01-17T19:40:44.000Z | marrow/mongo/core/field/date.py | marrow/mongo | 1a8e5fe9047b6a5bb2eaeea95f3dc085c737067f | [
"MIT"
] | 5 | 2016-06-24T06:55:44.000Z | 2021-07-12T22:33:07.000Z | # encoding: utf-8
"""Marrow Mongo Date field specialization.
Commentary on high-level management of timezone casting:
https://groups.google.com/forum/#!topic/mongodb-user/GOMjTJON4cg
"""
from __future__ import unicode_literals
from datetime import datetime, timedelta, tzinfo
from bson import ObjectId as OID
from ... | 28.611111 | 109 | 0.706796 |
83750d3011aa424921e5facb63cffb3803a69123 | 2,395 | py | Python | src/pybind/nnet3/nnet_chain_example_pybind_test.py | aadps/kaldi | cd351bb31c98f9d540c409478cbf2c5fef1853ca | [
"Apache-2.0"
] | null | null | null | src/pybind/nnet3/nnet_chain_example_pybind_test.py | aadps/kaldi | cd351bb31c98f9d540c409478cbf2c5fef1853ca | [
"Apache-2.0"
] | null | null | null | src/pybind/nnet3/nnet_chain_example_pybind_test.py | aadps/kaldi | cd351bb31c98f9d540c409478cbf2c5fef1853ca | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2019 Mobvoi AI Lab, Beijing, China (author: Fangjun Kuang)
# Apache 2.0
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir))
import unittest
import kaldi
from kaldi import NnetChainExampleWriter
from kaldi import RandomAccessNnetChainExampleR... | 33.732394 | 99 | 0.642589 |
f5127601ac24d415c38de0303448bc41ed2d8d44 | 514 | py | Python | pyppeteer_stealth/navigator_webdriver.py | sudoguy/pyppeteer_stealth | 6ba60938cfc07ab7301e31499f4c41960f8d620d | [
"MIT"
] | 1 | 2021-03-19T06:47:45.000Z | 2021-03-19T06:47:45.000Z | pyppeteer_stealth/navigator_webdriver.py | sudoguy/pyppeteer_stealth | 6ba60938cfc07ab7301e31499f4c41960f8d620d | [
"MIT"
] | null | null | null | pyppeteer_stealth/navigator_webdriver.py | sudoguy/pyppeteer_stealth | 6ba60938cfc07ab7301e31499f4c41960f8d620d | [
"MIT"
] | 1 | 2021-03-16T18:29:59.000Z | 2021-03-16T18:29:59.000Z | from pyppeteer.page import Page
async def navigator_webdriver(page: Page) -> None:
await page.evaluateOnNewDocument(
"""
() => {
Object.defineProperty(window, 'navigator', {
value: new Proxy(navigator, {
has: (target, key) => (key === 'webdriver' ? false : key in target),
get: (target,... | 23.363636 | 74 | 0.538911 |
0b958b61d5048b080c23afa08fc5ab33f88e4f7f | 16,668 | py | Python | src/ebay_rest/api/sell_fulfillment/models/line_item_fulfillment_instructions.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | null | null | null | src/ebay_rest/api/sell_fulfillment/models/line_item_fulfillment_instructions.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | null | null | null | src/ebay_rest/api/sell_fulfillment/models/line_item_fulfillment_instructions.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Fulfillment API
Use the Fulfillment API to complete the process of packaging, addressing, handling, and shipping each order on behalf of the seller, in accordance with the payment method and timing specified at checkout. # noqa: E501
OpenAPI spec version: v1.19.9
Generated b... | 84.609137 | 2,385 | 0.719642 |
1ce538e77ebe680a6bed4051cdd28c416b577d0e | 1,044 | py | Python | 2013/bot-core/ycore/module/config.py | daemon/old-stuff | 0e13928686add84f84d9743f2c8abfabc1c587bd | [
"MIT"
] | null | null | null | 2013/bot-core/ycore/module/config.py | daemon/old-stuff | 0e13928686add84f84d9743f2c8abfabc1c587bd | [
"MIT"
] | null | null | null | 2013/bot-core/ycore/module/config.py | daemon/old-stuff | 0e13928686add84f84d9743f2c8abfabc1c587bd | [
"MIT"
] | null | null | null | import json
class ConfigManager:
def __init__(self, filename="../../config.ini"):
try:
with open(filename) as f
self.lib = json.load(f)
except:
print("Improper config file")
def setConfig(self, lib):
self.lib = lib
@... | 24.27907 | 53 | 0.477969 |
2a3d032513f1b3d00b0413e797c77d46ba9fa0de | 29,548 | py | Python | models/nasnet_mobile_onfire.py | WinterWinds-Robotics/efficient_compact_fire-detection_cnn | c9b5886c0e8ffae7c38059c0dd4c646d0b2c0348 | [
"MIT"
] | 23 | 2021-05-12T03:09:18.000Z | 2022-02-24T01:24:41.000Z | models/nasnet_mobile_onfire.py | WinterWinds-Robotics/efficient_compact_fire-detection_cnn | c9b5886c0e8ffae7c38059c0dd4c646d0b2c0348 | [
"MIT"
] | 4 | 2021-09-27T17:40:55.000Z | 2022-01-20T01:07:27.000Z | models/nasnet_mobile_onfire.py | WinterWinds-Robotics/efficient_compact_fire-detection_cnn | c9b5886c0e8ffae7c38059c0dd4c646d0b2c0348 | [
"MIT"
] | 8 | 2021-05-12T12:41:10.000Z | 2021-12-27T10:34:43.000Z | """
NASNet Mobile - ONFIRE
Thanks to Anastasiia (https://github.com/DagnyT) for the great help, support and motivation!
------------------------------------------------------------------------------------
Architecture | Top-1 Acc | Top-5 Acc | Multiply-Adds | Params (M)
-----------------------------------... | 45.810853 | 136 | 0.674259 |
89a950c52641f7693d6d89f2799c0f7308208fdc | 514 | py | Python | Aula17/exercicio/Resolucao/exercicio4.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | Aula17/exercicio/Resolucao/exercicio4.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | Aula17/exercicio/Resolucao/exercicio4.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | # Faça um programa que lê um numero inteiro do teclado e mostre a soma do numero com os
# valores da seguinte tupla:
# (61, 138, 13, 86, 7, 160, 150, 90, 182, 158, 167, 171, 79, 162, 197, 63, 164, 22, 194, 17, 168)
# use o f-string para apresentar o numero.
tupla = (61, 138, 13, 86, 7, 160, 150, 90, 182, 158, 167, ... | 42.833333 | 103 | 0.645914 |
15bb7471637151ef2ae6af0658b76ddcf09e2bdc | 1,941 | py | Python | check.py | lukemetz/Paranormal | dddbb5df4a2a6c52defa3216b9e942645e397011 | [
"MIT"
] | 21 | 2015-04-26T18:40:01.000Z | 2021-01-19T09:02:58.000Z | check.py | lukemetz/Paranormal | dddbb5df4a2a6c52defa3216b9e942645e397011 | [
"MIT"
] | 73 | 2015-03-27T00:57:02.000Z | 2015-04-29T21:33:18.000Z | check.py | lukemetz/Paranormal | dddbb5df4a2a6c52defa3216b9e942645e397011 | [
"MIT"
] | 4 | 2015-04-29T21:42:20.000Z | 2021-01-19T09:02:59.000Z | #!/usr/bin/env python
import commands
import subprocess
import sys
from tools.check_tidy import check_tidy
def tidy():
err = check_tidy()
return err
def build():
build_command = "xctool -project Paranormal/Paranormal.xcodeproj/ -scheme Paranormal"
err = run(build_command)
return err
def tests():... | 24.56962 | 93 | 0.604328 |
3eb9d06066159bb0c376893bdf8455a9efa250cb | 1,692 | py | Python | wechatlogin/xmlrpc.py | CaulyKan/TracWechatLoginPlugin | 7bcfd222f83c8cf1200fde03958efa10a768e377 | [
"BSD-3-Clause"
] | null | null | null | wechatlogin/xmlrpc.py | CaulyKan/TracWechatLoginPlugin | 7bcfd222f83c8cf1200fde03958efa10a768e377 | [
"BSD-3-Clause"
] | null | null | null | wechatlogin/xmlrpc.py | CaulyKan/TracWechatLoginPlugin | 7bcfd222f83c8cf1200fde03958efa10a768e377 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf8 -*-
#
# Copyright (C) Cauly Kan, mail: cauliflower.kan@gmail.com
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
from trac.core import Component, implements
from tracrpc.api import IXMLRPCHandler
fr... | 31.333333 | 118 | 0.59279 |
41ce76ba0b9b44070f75f686134edeeafcddc94c | 878 | py | Python | optical-character-recognition/_source/checking-opencv-version/check_version.py | quanict/ict-article | f491b2d19f2080dcef247a02bf5deaeaa99fbadc | [
"MIT"
] | null | null | null | optical-character-recognition/_source/checking-opencv-version/check_version.py | quanict/ict-article | f491b2d19f2080dcef247a02bf5deaeaa99fbadc | [
"MIT"
] | 11 | 2020-03-24T17:23:44.000Z | 2022-03-11T23:52:03.000Z | optical-character-recognition/_source/checking-opencv-version/check_version.py | quanict/ict-article | f491b2d19f2080dcef247a02bf5deaeaa99fbadc | [
"MIT"
] | null | null | null | # USAGE
# python check_version.py
# import the necessary packages
from __future__ import print_function
import imutils
import cv2
# load the Tetris block image, convert it to grayscale, and threshold
# the image
print("OpenCV Version: {}".format(cv2.__version__))
image = cv2.imread("tetris_blocks.png")
gray = cv2.cvt... | 30.275862 | 69 | 0.747153 |
fa1377017ba81c995a6377c1625d5166a679994b | 4,975 | py | Python | instagram/settings.py | gabyxbinnaeah/TwinterApp | a0f68527a3e01cd47e49f9a17988ec5095422695 | [
"MIT"
] | null | null | null | instagram/settings.py | gabyxbinnaeah/TwinterApp | a0f68527a3e01cd47e49f9a17988ec5095422695 | [
"MIT"
] | null | null | null | instagram/settings.py | gabyxbinnaeah/TwinterApp | a0f68527a3e01cd47e49f9a17988ec5095422695 | [
"MIT"
] | null | null | null | """
Django settings for instagram project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
from decou... | 25.126263 | 91 | 0.689648 |
677122f12830c48bc569668463aecac20c97dc8a | 24,470 | py | Python | tests/test_manager/test_manager.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | tests/test_manager/test_manager.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | tests/test_manager/test_manager.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 Fetch.AI Limited
#
# 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 ... | 37.879257 | 164 | 0.63302 |
62c866f3d520469806c3959021c78159217a3e2e | 105 | py | Python | test/__init__.py | richdevboston/markovify | 7c62526c5cdfdf80439a9bd034e2bf49b2a421b8 | [
"MIT"
] | 3,141 | 2015-01-02T21:38:56.000Z | 2022-03-29T22:31:28.000Z | test/__init__.py | richdevboston/markovify | 7c62526c5cdfdf80439a9bd034e2bf49b2a421b8 | [
"MIT"
] | 158 | 2015-07-27T13:54:08.000Z | 2022-03-03T02:42:24.000Z | test/__init__.py | richdevboston/markovify | 7c62526c5cdfdf80439a9bd034e2bf49b2a421b8 | [
"MIT"
] | 434 | 2015-01-12T15:54:32.000Z | 2022-03-17T19:04:31.000Z | __all__ = [
"test_basic",
"test_combine",
]
from . import test_basic
from . import test_combine
| 13.125 | 26 | 0.67619 |
0927913e79408a6eb041db0d2f53f34a0decc2bd | 13,975 | py | Python | models/gated_scnn/gated_shape_cnn/training/loss.py | LivingSkyTechnologies/Document_Layout_Segmentation | 0db00a18fb39afa1efa8ae183bbd57309a6ebfcf | [
"MIT"
] | 4 | 2021-01-28T23:06:43.000Z | 2022-01-15T19:17:07.000Z | models/gated_scnn/gated_shape_cnn/training/loss.py | LivingSkyTechnologies/Document_Layout_Segmentation | 0db00a18fb39afa1efa8ae183bbd57309a6ebfcf | [
"MIT"
] | 2 | 2021-01-25T21:54:05.000Z | 2021-08-23T21:19:21.000Z | models/gated_scnn/gated_shape_cnn/training/loss.py | LivingSkyTechnologies/Document_Layout_Segmentation | 0db00a18fb39afa1efa8ae183bbd57309a6ebfcf | [
"MIT"
] | 2 | 2021-01-28T13:39:33.000Z | 2022-01-15T19:17:13.000Z | import tensorflow as tf
import tensorflow_addons as tfa
from models.gated_scnn.gated_shape_cnn.model.layers import gradient_mag
@tf.function(experimental_relax_shapes=True)
def _generalised_dice(y_true, y_pred, eps=0.0, from_logits=True):
"""
:param y_true [b, h, w, c]:
:param y_pred [b, h, w, c]:
:par... | 40.04298 | 209 | 0.680716 |
7618872145eb9727a7d6ddd2b51d1c4eddaf56e0 | 32,416 | py | Python | tensorflow/python/ops/rnn_cell.py | StryxZilla/tensor | ae5cc4cc3e6b2fb19e79ba61d1f761f919ed110c | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/rnn_cell.py | StryxZilla/tensor | ae5cc4cc3e6b2fb19e79ba61d1f761f919ed110c | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/rnn_cell.py | StryxZilla/tensor | ae5cc4cc3e6b2fb19e79ba61d1f761f919ed110c | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Google 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
#
# Unless required by applicable law or a... | 37.216992 | 80 | 0.677628 |
9cc68afeb9655c8dd4741345f67dfa322fb6817c | 3,292 | py | Python | FinMind/BackTestSystem/Strategies/ShortSaleMarginPurchaseRatio.py | hanyang0721/FinMind | 1f5526482e8926824803fba6e1b4a19e25f7dab3 | [
"Apache-2.0"
] | 1 | 2021-05-30T12:11:34.000Z | 2021-05-30T12:11:34.000Z | FinMind/BackTestSystem/Strategies/ShortSaleMarginPurchaseRatio.py | EasonLee1128/FinMind | 1f5526482e8926824803fba6e1b4a19e25f7dab3 | [
"Apache-2.0"
] | null | null | null | FinMind/BackTestSystem/Strategies/ShortSaleMarginPurchaseRatio.py | EasonLee1128/FinMind | 1f5526482e8926824803fba6e1b4a19e25f7dab3 | [
"Apache-2.0"
] | 1 | 2021-01-15T08:29:37.000Z | 2021-01-15T08:29:37.000Z | import numpy as np
import pandas as pd
from ta.momentum import StochasticOscillator
from FinMind.BackTestSystem.BaseClass import Strategy
from FinMind.Data import Load
class ShortSaleMarginPurchaseRatio(Strategy):
"""
url: "https://blog.above.tw/2018/08/15/%E7%B1%8C%E7%A2%BC%E9%9D%A2%E7%9A%84%E9%97%9C%E9%8D%... | 35.021277 | 153 | 0.611482 |
7d7aa5e03566095bc8f58935a76e339c3728871d | 1,111 | py | Python | tests/test_bucket.py | B1gG/cuckoopy | e5fab0c4826387f99ddafb0365759cb7111cfd64 | [
"MIT"
] | 23 | 2017-02-11T07:18:51.000Z | 2021-11-24T09:18:53.000Z | tests/test_bucket.py | B1gG/cuckoopy | e5fab0c4826387f99ddafb0365759cb7111cfd64 | [
"MIT"
] | 2 | 2019-05-11T22:10:36.000Z | 2020-07-02T12:44:16.000Z | tests/test_bucket.py | B1gG/cuckoopy | e5fab0c4826387f99ddafb0365759cb7111cfd64 | [
"MIT"
] | 10 | 2017-05-27T09:20:08.000Z | 2021-03-20T07:27:36.000Z | import pytest
from cuckoopy.bucket import Bucket
@pytest.fixture
def bucket():
return Bucket()
def test_insert(bucket):
assert bucket.insert('fake_value')
def test_insert_bucket_full(bucket):
for i in range(bucket.size):
bucket.insert('fake_value1')
assert not bucket.insert('fake_value2')... | 22.22 | 55 | 0.744374 |
4b3d6f9e3c855f4b6af53a17cba4a2a257fa9a89 | 8,050 | py | Python | evaluation_script/drive_lstm3states.py | dr563105/basicad_framework | 0d820390116dcd58ac7061074b5e33cb0c2f26de | [
"MIT"
] | null | null | null | evaluation_script/drive_lstm3states.py | dr563105/basicad_framework | 0d820390116dcd58ac7061074b5e33cb0c2f26de | [
"MIT"
] | null | null | null | evaluation_script/drive_lstm3states.py | dr563105/basicad_framework | 0d820390116dcd58ac7061074b5e33cb0c2f26de | [
"MIT"
] | null | null | null | import rclpy
from rclpy.node import Node
from rclpy.timer import WallTimer
from geometry_msgs.msg import TwistStamped
from sensor_msgs.msg import CompressedImage
import message_filters
import threading
import numpy as np
import cv2
import os
import tensorflow as tf
from keras import backend as K
from keras.models impor... | 40.25 | 145 | 0.621242 |
b58861626a3b99c589925b528a9ad1613f2563a9 | 354 | py | Python | implementation/helper/io/json.py | saurabbhsp/mesh-3d-reconstruction | c52312bce7e3121643189f6b67192ffe28b08565 | [
"Apache-2.0"
] | null | null | null | implementation/helper/io/json.py | saurabbhsp/mesh-3d-reconstruction | c52312bce7e3121643189f6b67192ffe28b08565 | [
"Apache-2.0"
] | null | null | null | implementation/helper/io/json.py | saurabbhsp/mesh-3d-reconstruction | c52312bce7e3121643189f6b67192ffe28b08565 | [
"Apache-2.0"
] | null | null | null | import json
import os
def json_file_reader(filePath):
json_string = None
with open(filePath, 'r') as file:
json_string = file.read()
return json.loads(json_string)
def dict_to_json(filePath, data):
os.makedirs(os.path.dirname(filePath), exist_ok=True)
with open(filePath, 'w') as outfile:... | 22.125 | 57 | 0.686441 |
2053db666816c7e1640ef2ab80f01cfc089a8a8d | 2,464 | py | Python | tests/test_formats.py | ghtyrant/skjold | 1ce7dee2ef410ded3a4f4f045838317dcaf9a686 | [
"MIT"
] | null | null | null | tests/test_formats.py | ghtyrant/skjold | 1ce7dee2ef410ded3a4f4f045838317dcaf9a686 | [
"MIT"
] | null | null | null | tests/test_formats.py | ghtyrant/skjold | 1ce7dee2ef410ded3a4f4f045838317dcaf9a686 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import io
import os
import pytest
from skjold.formats import extract_package_list_from, read_requirements_txt_from
from skjold.models import PackageList
from skjold.tasks import Configuration
def format_fixture_path_for(folder: str, filename: str) -> str:
path_ = os.path.join(
os... | 32.853333 | 87 | 0.646104 |
1340ad2e5ae4bf633cfdbb1ca3cca321b7b72c71 | 4,568 | py | Python | software/multifluids_icferst/examples/rotating_channel/channel_tools.py | msc-acse/acse-9-independent-research-project-Wade003 | cfcba990d52ccf535171cf54c0a91b184db6f276 | [
"MIT"
] | 2 | 2020-05-11T02:39:46.000Z | 2020-05-11T03:08:38.000Z | software/multifluids_icferst/examples/rotating_channel/channel_tools.py | msc-acse/acse-9-independent-research-project-Wade003 | cfcba990d52ccf535171cf54c0a91b184db6f276 | [
"MIT"
] | null | null | null | software/multifluids_icferst/examples/rotating_channel/channel_tools.py | msc-acse/acse-9-independent-research-project-Wade003 | cfcba990d52ccf535171cf54c0a91b184db6f276 | [
"MIT"
] | 2 | 2020-05-21T22:50:19.000Z | 2020-10-28T17:16:31.000Z | import os
from fluidity_tools import stat_parser
from sympy import *
from numpy import array,max,abs
meshtemplate='''
Point(1) = {0, 0, 0, <dx>};
Extrude {0, 1, 0} {
Point{1};Layers{<layers>};
}
Point(3) = {1, 0, 0, <dx>};
Extrude {0, 1, 0} {
Point{3};Layers{<layers>};
}
Line(3)={1,3};
Line(4)={2,4};
Line Loop(5) ... | 23.91623 | 90 | 0.618651 |
5817af845ffa615ae42f225d4d8c6a8a8ac7264e | 338 | py | Python | awari-2.0/test_awari20.py | ssebastianj/taip-2012 | 32b9db4e5ce968ee559773c8eaf4602184b285df | [
"MIT"
] | null | null | null | awari-2.0/test_awari20.py | ssebastianj/taip-2012 | 32b9db4e5ce968ee559773c8eaf4602184b285df | [
"MIT"
] | null | null | null | awari-2.0/test_awari20.py | ssebastianj/taip-2012 | 32b9db4e5ce968ee559773c8eaf4602184b285df | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from solution import Awari
class TestAwari20(object):
@classmethod
def setup_class(cls):
cls.awari = Awari()
def test_solve(self):
assert self.awari.solve([1, 2, 3]) == 'N'
assert self.awari.solve([1, 1, 3, 0]) == 'S'
assert self.awari.solve([0, 1,... | 22.533333 | 55 | 0.556213 |
1c144173aafadf2e5513c70f77213f511972394d | 1,736 | py | Python | cesium/features/tests/test_graphs.py | acrellin/cesium | 9d33edc0f9b3a79c68070826c0f390896abe294d | [
"BSD-3-Clause"
] | 603 | 2016-04-15T00:11:07.000Z | 2022-03-18T09:10:39.000Z | cesium/features/tests/test_graphs.py | acrellin/cesium | 9d33edc0f9b3a79c68070826c0f390896abe294d | [
"BSD-3-Clause"
] | 146 | 2016-03-17T19:58:24.000Z | 2022-02-05T20:36:03.000Z | cesium/features/tests/test_graphs.py | acrellin/cesium | 9d33edc0f9b3a79c68070826c0f390896abe294d | [
"BSD-3-Clause"
] | 84 | 2016-04-13T23:30:58.000Z | 2022-03-18T07:34:09.000Z | import os
import numpy as np
import numpy.testing as npt
from cesium import data_management
from cesium.features import graphs
from cesium.features.tests.util import generate_features
# Fixed set of features w/ known values
SCIENCE_FEATS = graphs.GENERAL_FEATS + graphs.LOMB_SCARGLE_FEATS
def test_feature_generatio... | 36.93617 | 67 | 0.692972 |
6e30901cd6f8bae42f1ff948fc98f8825fb1d47e | 764 | py | Python | tests/cases/doc/test_nested.py | broglep-work/python-pytest-cases | 4976c0073a2fad5fbe5de34a5d1199efda0b7da9 | [
"BSD-3-Clause"
] | 213 | 2018-07-05T21:21:21.000Z | 2022-03-22T04:54:53.000Z | tests/cases/doc/test_nested.py | broglep-work/python-pytest-cases | 4976c0073a2fad5fbe5de34a5d1199efda0b7da9 | [
"BSD-3-Clause"
] | 259 | 2018-06-22T16:46:33.000Z | 2022-03-23T19:39:15.000Z | tests/cases/doc/test_nested.py | broglep-work/python-pytest-cases | 4976c0073a2fad5fbe5de34a5d1199efda0b7da9 | [
"BSD-3-Clause"
] | 27 | 2019-03-26T12:46:49.000Z | 2022-02-21T16:56:23.000Z | from pytest_cases import parametrize_with_cases
class FooCases:
def case_1(self):
return 1
class SubFooCases:
def case_2(self):
return 2
class SubSubFooCases:
def case_3(self):
return 3
def case_3(self): # duplicate name; on purpose
... | 18.190476 | 51 | 0.668848 |
aa4d4b6eb02ede6a78484e70382ec88b14973c78 | 286 | py | Python | plugins/__init__.py | jrderek/Movie_Analytics-Data-Engineering- | 9789b2d4a13964b93f7f99b010137e9c4e6cc807 | [
"MIT"
] | null | null | null | plugins/__init__.py | jrderek/Movie_Analytics-Data-Engineering- | 9789b2d4a13964b93f7f99b010137e9c4e6cc807 | [
"MIT"
] | null | null | null | plugins/__init__.py | jrderek/Movie_Analytics-Data-Engineering- | 9789b2d4a13964b93f7f99b010137e9c4e6cc807 | [
"MIT"
] | null | null | null | from __future__ import division, absolute_import, print_function
from airflow.plugins_manager import AirflowPlugin
import operators
# Defining the plugin class
class MoviesPlugin(AirflowPlugin):
name = "movies_plugin"
operators = [
operators.DataQualityOperator
] | 23.833333 | 64 | 0.77972 |
45a4e1bfd47da330c490c3baf78f6a027f669fa7 | 6,679 | py | Python | Environment/SingleAssetEnvironment.py | catbrower/FinRL | 53a22fbc3b55a86c6dd14a013597b3586b265640 | [
"MIT"
] | null | null | null | Environment/SingleAssetEnvironment.py | catbrower/FinRL | 53a22fbc3b55a86c6dd14a013597b3586b265640 | [
"MIT"
] | null | null | null | Environment/SingleAssetEnvironment.py | catbrower/FinRL | 53a22fbc3b55a86c6dd14a013597b3586b265640 | [
"MIT"
] | null | null | null | from copy import deepcopy
import numpy as np
import pandas as pd
import gym
from gym import spaces
from gym.utils import seeding
from stable_baselines3.common.vec_env import DummyVecEnv, SubprocVecEnv
from stable_baselines3.common import logger
###
# This new env is only supposed to set position correctly, not actual... | 37.312849 | 136 | 0.616559 |
d5f984cf363d9697314215ade9881bcf26c5bcde | 32 | py | Python | dags/__init__.py | k2k1422/airflow | 065dee55345637134d87b9add7f4819200f6668e | [
"Apache-2.0"
] | null | null | null | dags/__init__.py | k2k1422/airflow | 065dee55345637134d87b9add7f4819200f6668e | [
"Apache-2.0"
] | null | null | null | dags/__init__.py | k2k1422/airflow | 065dee55345637134d87b9add7f4819200f6668e | [
"Apache-2.0"
] | null | null | null | print("Inside dags folder init") | 32 | 32 | 0.78125 |
ce72bbca89ff3ed61dfdc1c7a383076c10bca1d8 | 299 | py | Python | dotdict.py | Jovvik/Thesis | 68a2bd3434e986f9f914f2af21d2ec1d469b2bc8 | [
"MIT"
] | null | null | null | dotdict.py | Jovvik/Thesis | 68a2bd3434e986f9f914f2af21d2ec1d469b2bc8 | [
"MIT"
] | null | null | null | dotdict.py | Jovvik/Thesis | 68a2bd3434e986f9f914f2af21d2ec1d469b2bc8 | [
"MIT"
] | null | null | null | from typing import Any
class dotdict(dict):
"""dot.notation access to dictionary attributes"""
def __getattr__(*args: Any) -> Any:
val = dict.get(*args)
return dotdict(val) if type(val) is dict else val
__setattr__ = dict.__setitem__
__delattr__ = dict.__delitem__
| 27.181818 | 57 | 0.675585 |
5bf4138ff78a1030ca167666d8139a8977d727e6 | 2,637 | py | Python | day10.py | jjayala1/adventofCode2020 | d5587fd812368d2ff24f215d904ddf258dd0a4a8 | [
"MIT"
] | null | null | null | day10.py | jjayala1/adventofCode2020 | d5587fd812368d2ff24f215d904ddf258dd0a4a8 | [
"MIT"
] | null | null | null | day10.py | jjayala1/adventofCode2020 | d5587fd812368d2ff24f215d904ddf258dd0a4a8 | [
"MIT"
] | null | null | null | import itertools
def clean_data():
f = open('day10b.txt','r')
data = [int(x.replace('\n','')) for x in f.readlines()]
data.sort()
return data
def sort_adapters(data):
dif1 = 1
dif3 = 1
for i in range(len(data)-1):
dif = data[i+1] - data[i]
#print(f'{i} -- {data[i+1]} -... | 21.975 | 94 | 0.523701 |
f71d3032e42d801860be4840ffd19a2487705594 | 17,260 | py | Python | test/functional/vuicash_condensing_txs.py | vuicash/qtum | fbc207749ed96e64073b96bd8768356e6b16ecf6 | [
"MIT"
] | null | null | null | test/functional/vuicash_condensing_txs.py | vuicash/qtum | fbc207749ed96e64073b96bd8768356e6b16ecf6 | [
"MIT"
] | null | null | null | test/functional/vuicash_condensing_txs.py | vuicash/qtum | fbc207749ed96e64073b96bd8768356e6b16ecf6 | [
"MIT"
] | 1 | 2022-01-10T00:08:47.000Z | 2022-01-10T00:08:47.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from tes... | 76.711111 | 2,543 | 0.773638 |
05f2291a5306edb528a9fedb3f65fbe27f003690 | 2,791 | py | Python | tensorflow_datasets/testing/fake_data_generation/colorectal_histology.py | shashwat9kumar/datasets | 99b055408025f8e934fcbb0fc054488aa087ebfb | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/testing/fake_data_generation/colorectal_histology.py | shashwat9kumar/datasets | 99b055408025f8e934fcbb0fc054488aa087ebfb | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/testing/fake_data_generation/colorectal_histology.py | shashwat9kumar/datasets | 99b055408025f8e934fcbb0fc054488aa087ebfb | [
"Apache-2.0"
] | 1 | 2021-08-02T22:12:40.000Z | 2021-08-02T22:12:40.000Z | # coding=utf-8
# Copyright 2021 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 32.453488 | 79 | 0.742386 |
d3363f85a7ac1c26e7fe894f7d638067482877b1 | 21,105 | py | Python | src/ebay_rest/api/buy_deal/models/event_item.py | gbm001/ebay_rest | 077d3478423ccd80ff35e0361821d6a11180bc54 | [
"MIT"
] | 3 | 2021-12-12T04:28:03.000Z | 2022-03-10T03:29:18.000Z | src/ebay_rest/api/buy_deal/models/event_item.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 33 | 2021-06-16T20:44:36.000Z | 2022-03-30T14:55:06.000Z | src/ebay_rest/api/buy_deal/models/event_item.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 7 | 2021-06-03T09:30:23.000Z | 2022-03-08T19:51:33.000Z | # coding: utf-8
"""
Deal API
<span class=\"tablenote\"><b>Note:</b> This is a <a href=\"https://developer.ebay.com/api-docs/static/versioning.html#limited\" target=\"_blank\"> <img src=\"/cms/img/docs/partners-api.svg\" class=\"legend-icon partners-icon\" title=\"Limited Release\" alt=\"Limited Release\" />(... | 34.655172 | 569 | 0.63838 |
3c753dde805dba51d02200dcbfb3cad7b4ccf38a | 11,690 | py | Python | kivy/uix/dropdown.py | Sentient07/kivy | e5022e1cc84b1bcda6e4619d618509dc4ea7da04 | [
"MIT"
] | 317 | 2015-07-30T07:47:41.000Z | 2022-03-30T00:38:39.000Z | kivy/uix/dropdown.py | waderly/kivy | 1bfa50bcbe83350f42f002bc217d381e4878666d | [
"MIT"
] | 42 | 2015-07-30T10:32:46.000Z | 2021-11-23T02:44:47.000Z | kivy/uix/dropdown.py | waderly/kivy | 1bfa50bcbe83350f42f002bc217d381e4878666d | [
"MIT"
] | 69 | 2015-08-04T03:27:30.000Z | 2021-12-27T09:53:26.000Z | '''
Drop-Down List
==============
.. versionadded:: 1.4.0
A versatile drop-down list that can be used with custom widgets. It allows you
to display a list of widgets under a displayed widget. Unlike other toolkits,
the list of widgets can contain any type of widget: simple buttons,
images etc.
The positioning of the... | 33.116147 | 80 | 0.632592 |
a5ab902eb741a5e9caf4503b0229ddf44f74c589 | 3,403 | py | Python | aiologger/loggers/json.py | spolloni/aiologger | d363293cfb8dd8c900b5fac4df355f9595b61fde | [
"MIT"
] | 1 | 2020-04-30T18:25:08.000Z | 2020-04-30T18:25:08.000Z | aiologger/loggers/json.py | spolloni/aiologger | d363293cfb8dd8c900b5fac4df355f9595b61fde | [
"MIT"
] | null | null | null | aiologger/loggers/json.py | spolloni/aiologger | d363293cfb8dd8c900b5fac4df355f9595b61fde | [
"MIT"
] | null | null | null | import json
from datetime import timezone
from asyncio import AbstractEventLoop
from typing import Dict, Iterable, Callable, Tuple, Any, Optional, Mapping
from aiologger import Logger
from aiologger.formatters.base import Formatter
from aiologger.formatters.json import ExtendedJsonFormatter
from aiologger.levels impor... | 30.383929 | 75 | 0.594769 |
24a0f96947b29f13ff685184cb13b94e608836ec | 14,319 | py | Python | test/functional/wallet_address_types.py | frolosofsky/unit-e | d3d12508b915986841bd19c4dee9e50dd662a112 | [
"MIT"
] | null | null | null | test/functional/wallet_address_types.py | frolosofsky/unit-e | d3d12508b915986841bd19c4dee9e50dd662a112 | [
"MIT"
] | null | null | null | test/functional/wallet_address_types.py | frolosofsky/unit-e | d3d12508b915986841bd19c4dee9e50dd662a112 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test that the wallet can send and receive using all combinations of address types.
There are 5 nodes-under-... | 48.212121 | 205 | 0.649836 |
61c561da300f8a6c042f92f54feea5382e0e7cec | 218 | bzl | Python | tools/build_defs/apple/fb_apple_test.bzl | alleniver/react-native | e22b760e594db97c22b34084a1770ac3a40c0ccf | [
"CC-BY-4.0",
"MIT"
] | 217 | 2019-03-25T17:44:40.000Z | 2020-10-21T22:43:22.000Z | tools/build_defs/apple/fb_apple_test.bzl | Wenxchn/react-native | 05c594d2f5f41879ecca74bfa9716a161c20bf13 | [
"CC-BY-4.0",
"MIT"
] | 227 | 2019-05-07T23:55:52.000Z | 2020-05-05T05:04:42.000Z | tools/build_defs/apple/fb_apple_test.bzl | Wenxchn/react-native | 05c594d2f5f41879ecca74bfa9716a161c20bf13 | [
"CC-BY-4.0",
"MIT"
] | 32 | 2019-05-13T20:03:01.000Z | 2020-04-28T02:31:25.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
def fb_apple_test(**kwargs):
pass
| 27.25 | 65 | 0.743119 |
738c258745ab5e85cf38cfc85a41b986373d4e4a | 1,289 | py | Python | Tests/loss.py | ElaineYao/TensorFI | 96890d269dc619ca946f1082fdc6a8195b75cb4a | [
"MIT"
] | 35 | 2018-10-28T22:41:31.000Z | 2022-03-27T21:47:40.000Z | Tests/loss.py | bigmpc/TensorFI | 3d75830ff202fdf98cf28acd842209ad7f6e6e2a | [
"MIT"
] | 28 | 2019-08-26T17:52:37.000Z | 2021-06-13T01:04:00.000Z | Tests/loss.py | bigmpc/TensorFI | 3d75830ff202fdf98cf28acd842209ad7f6e6e2a | [
"MIT"
] | 30 | 2018-11-08T02:52:06.000Z | 2022-03-27T21:57:47.000Z | #!/usr/bin/python
# Example 4 from TensorFlow tutorial
from __future__ import print_function
import sys
import tensorflow as tf
sys.path.append("/data/gpli/tensorfi/TensorFI/TensorFI/")
import TensorFI as ti
# Create 2 variables for keeping track of weights
W = tf.Variable([.3], dtype=tf.float32)
b = tf.Variable([-... | 31.439024 | 79 | 0.68813 |
59235cd56fad0a8f8ef85b316b9a06714f3cbe8b | 440 | py | Python | apps/events/migrations/0006_auto_20210422_1129.py | Houston-ARTCC/zhu-core | 99a2f95fa7c61e27560557b3a8aee41cc995d101 | [
"MIT"
] | 1 | 2020-12-25T04:21:07.000Z | 2020-12-25T04:21:07.000Z | apps/events/migrations/0006_auto_20210422_1129.py | Houston-ARTCC/zhu-core | 99a2f95fa7c61e27560557b3a8aee41cc995d101 | [
"MIT"
] | 3 | 2021-09-21T18:22:51.000Z | 2021-12-10T20:31:19.000Z | apps/events/migrations/0006_auto_20210422_1129.py | Houston-ARTCC/zhu-core | 99a2f95fa7c61e27560557b3a8aee41cc995d101 | [
"MIT"
] | 1 | 2021-04-13T23:33:39.000Z | 2021-04-13T23:33:39.000Z | # Generated by Django 3.1.7 on 2021-04-22 15:29
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0005_auto_20210319_1800'),
]
operations = [
migrations.RemoveField(
model_name='positionshift',
name='end',
... | 20 | 47 | 0.568182 |
6390e2596356da23cb72f5fddfe177b8f9620f5d | 21,043 | py | Python | test/orm/test_instrumentation.py | obeattie/sqlalchemy | 376007fed7746d494dcb0166b22e512bfece02cd | [
"MIT"
] | 2 | 2016-05-09T09:17:35.000Z | 2016-08-03T16:30:16.000Z | test/orm/test_instrumentation.py | clones/sqlalchemy | c9f08aa78a48ba53dd221d3c5de54e5956ecf806 | [
"MIT"
] | null | null | null | test/orm/test_instrumentation.py | clones/sqlalchemy | c9f08aa78a48ba53dd221d3c5de54e5956ecf806 | [
"MIT"
] | null | null | null |
from sqlalchemy.test.testing import assert_raises, assert_raises_message
import sqlalchemy as sa
from sqlalchemy import MetaData, Integer, ForeignKey, util
from sqlalchemy.test.schema import Table
from sqlalchemy.test.schema import Column
from sqlalchemy.orm import mapper, relation, create_session, attributes, class_m... | 27.364109 | 115 | 0.540607 |
861737ed4480e89ab90705590ac8b9297aa1881e | 18,457 | py | Python | alphalens/_version.py | tradeasystems/alphalens | d3fe6c19c28bedbf992805f5420b0c0bc2039ffa | [
"Apache-2.0"
] | 2,343 | 2016-07-14T17:42:19.000Z | 2022-03-31T13:09:01.000Z | alphalens/_version.py | noisyoscillator/alphalens | 6ad2627614cf67793a7605e25c2cc102dcbd2f0c | [
"Apache-2.0"
] | 275 | 2016-07-15T14:37:27.000Z | 2022-03-29T06:34:21.000Z | alphalens/_version.py | noisyoscillator/alphalens | 6ad2627614cf67793a7605e25c2cc102dcbd2f0c | [
"Apache-2.0"
] | 933 | 2016-07-14T19:05:17.000Z | 2022-03-26T07:45:11.000Z |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | 35.426104 | 79 | 0.584656 |
1fb9b088d13c6856d5c5ee9047f3f52cbb618a8e | 1,297 | py | Python | python/ngraph/utils/input_validation.py | GBuella/ngraph | ec935c0bafc5ba8c6940d9c9dcf45ddeac487513 | [
"Apache-2.0"
] | null | null | null | python/ngraph/utils/input_validation.py | GBuella/ngraph | ec935c0bafc5ba8c6940d9c9dcf45ddeac487513 | [
"Apache-2.0"
] | null | null | null | python/ngraph/utils/input_validation.py | GBuella/ngraph | ec935c0bafc5ba8c6940d9c9dcf45ddeac487513 | [
"Apache-2.0"
] | null | null | null | # ******************************************************************************
# Copyright 2017-2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | 36.027778 | 83 | 0.637625 |
6251c9bb5d9af26f63a4e6cdf87298489aeec334 | 903 | py | Python | fm/migrations/0019_eventclassificationrule_action.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | fm/migrations/0019_eventclassificationrule_action.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | fm/migrations/0019_eventclassificationrule_action.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ----------------------------------------------------------------------
# eventclassificationrule action
# ----------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
... | 32.25 | 97 | 0.449612 |
37bc2d44c913b112c4ba59b75618871aa96dad8a | 948 | py | Python | aa_comp.py | annguyen642/learning_python | bb6a3965a8bf4e0974eb97b62c8fb3ab0b09602e | [
"MIT"
] | null | null | null | aa_comp.py | annguyen642/learning_python | bb6a3965a8bf4e0974eb97b62c8fb3ab0b09602e | [
"MIT"
] | null | null | null | aa_comp.py | annguyen642/learning_python | bb6a3965a8bf4e0974eb97b62c8fb3ab0b09602e | [
"MIT"
] | null | null | null | # Make a program that reports the amino acid composition in a file of proteins
import mcb185
import sys
total = 0
count = {}
for name, seq in mcb185.read_fasta(sys.argv[1]):
for aa in seq:
if aa == '*': continue
if aa in count:
count[aa] +=1
else: count[aa] =1
total += 1
for aa in count:
print(aa, count... | 22.571429 | 78 | 0.768987 |
a62d08c80edc270840e19e36e54cfc4516fb6df9 | 1,184 | py | Python | src/hyperparameters/ns_gnn_search.py | EmmaRocheteau/eICU-GNN-LSTM | 5167eea88bfe7a3146ccb6194f54e8e57f52128b | [
"MIT"
] | 53 | 2021-01-14T11:34:31.000Z | 2022-03-15T15:05:03.000Z | src/hyperparameters/ns_gnn_search.py | Wizard-gq/eICU-GNN-LSTM | 5167eea88bfe7a3146ccb6194f54e8e57f52128b | [
"MIT"
] | 2 | 2021-02-13T02:29:10.000Z | 2021-02-26T10:24:40.000Z | src/hyperparameters/ns_gnn_search.py | Wizard-gq/eICU-GNN-LSTM | 5167eea88bfe7a3146ccb6194f54e8e57f52128b | [
"MIT"
] | 15 | 2021-01-25T04:10:38.000Z | 2022-01-16T07:08:41.000Z | import os
os.environ["SLURM_JOB_NAME"] = "bash"
import pytorch_lightning as pl
from train_ns_gnn import get_data, NsGnnModel
from src.hyperparameters.search import ihm_TuneReportCallback, los_TuneReportCallback, main_tune
from src.args import init_lstmgnn_args, add_tune_params, add_configs
def main_train(config):
... | 33.828571 | 96 | 0.711993 |
6f7a2123687e8450b0a02c96eccde83f7f530213 | 29,691 | py | Python | netbox/ipam/models.py | bms8197/netbox | f7f6704fc1956427608c86870f4bd609df0fb8ef | [
"Apache-2.0"
] | 1 | 2019-01-08T05:37:03.000Z | 2019-01-08T05:37:03.000Z | netbox/ipam/models.py | nsitapara/netbox | f7f6704fc1956427608c86870f4bd609df0fb8ef | [
"Apache-2.0"
] | null | null | null | netbox/ipam/models.py | nsitapara/netbox | f7f6704fc1956427608c86870f4bd609df0fb8ef | [
"Apache-2.0"
] | null | null | null | import netaddr
from django.conf import settings
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ValidationError
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import Q
from django.db.models.expr... | 32.413755 | 120 | 0.61453 |
d349e6f3da4ceda026dd93b59f797583ddc4c243 | 6,845 | py | Python | tft/walmart-sales.py | smeyn/google-research | f574b497d05fa0d3726aeacf9ab907e5541cea10 | [
"Apache-2.0"
] | null | null | null | tft/walmart-sales.py | smeyn/google-research | f574b497d05fa0d3726aeacf9ab907e5541cea10 | [
"Apache-2.0"
] | null | null | null | tft/walmart-sales.py | smeyn/google-research | f574b497d05fa0d3726aeacf9ab907e5541cea10 | [
"Apache-2.0"
] | null | null | null | import sklearn.preprocessing # Used for data standardization
from libs import utils # Load TFT helper functions
from data_formatters.base import GenericDataFormatter, DataTypes, InputTypes
from libs.tft_model import TemporalFusionTransformer
from script_download_data import main as download_data
import pandas a... | 37.201087 | 108 | 0.637838 |
3e5f2b1c40807d32ac9567718ce03bc1fb853bf5 | 825 | py | Python | vsac_wrangler/bulkImport_cs_rest_api.py | callahantiff/ValueSet-Tools | 2a2999e07ea2abde336bd9c80f3a0ce39be4492f | [
"MIT"
] | null | null | null | vsac_wrangler/bulkImport_cs_rest_api.py | callahantiff/ValueSet-Tools | 2a2999e07ea2abde336bd9c80f3a0ce39be4492f | [
"MIT"
] | null | null | null | vsac_wrangler/bulkImport_cs_rest_api.py | callahantiff/ValueSet-Tools | 2a2999e07ea2abde336bd9c80f3a0ce39be4492f | [
"MIT"
] | null | null | null | from typing import Dict, List, OrderedDict
from bs4 import BeautifulSoup
import requests
import urllib3.util
import xmltodict as xd
print(pd.__version__)
###createNewConceptSet
##"ri.actions.main.parameter.36a1670f-49ca-4491-bb42-c38707bbcbb2":
##cs1 = { "type": "objectLocator",
## "objectLocator": {
## "objectT... | 23.571429 | 67 | 0.690909 |
53d52462446aad498fc34000e60775a6daaf0c69 | 1,266 | py | Python | services/core-api/app/api/now_applications/models/activity_summary/placer_operation.py | parc-jason/mds | 8f181a429442208a061ed72065b71e6c2bd0f76f | [
"Apache-2.0"
] | null | null | null | services/core-api/app/api/now_applications/models/activity_summary/placer_operation.py | parc-jason/mds | 8f181a429442208a061ed72065b71e6c2bd0f76f | [
"Apache-2.0"
] | null | null | null | services/core-api/app/api/now_applications/models/activity_summary/placer_operation.py | parc-jason/mds | 8f181a429442208a061ed72065b71e6c2bd0f76f | [
"Apache-2.0"
] | null | null | null | import uuid, datetime
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import validates
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.schema import FetchedValue
from app.extensions import db
from app.api.utils.models_mixins import AuditMixin, Base
from app.api.now_applications.... | 38.363636 | 102 | 0.770932 |
d490fe938362eae04d97aaf8a74ae06781d2143f | 545 | py | Python | helpdesk/migrations/0006_issuehistory_issue.py | unisport/drunken-platypus | 16e5411e8c2b32c4f7444f8cdc8e656f7b07e6dc | [
"MIT"
] | null | null | null | helpdesk/migrations/0006_issuehistory_issue.py | unisport/drunken-platypus | 16e5411e8c2b32c4f7444f8cdc8e656f7b07e6dc | [
"MIT"
] | 14 | 2016-09-05T08:51:54.000Z | 2022-01-18T06:41:33.000Z | helpdesk/migrations/0006_issuehistory_issue.py | unisport/drunken-platypus | 16e5411e8c2b32c4f7444f8cdc8e656f7b07e6dc | [
"MIT"
] | 2 | 2016-09-01T09:41:40.000Z | 2016-09-01T09:45:36.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-10-16 09:48
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('helpdesk', '0005_issuehistory'),
]
operations = [
... | 24.772727 | 116 | 0.651376 |
a0fbd5755546f1481a1dab7eb49770cf21bf7aa6 | 1,222 | py | Python | c10r/template_file.py | Teppen-io/c10r | e386d0ef9fed76118c0063185c61f182d56d9f5b | [
"MIT"
] | 2 | 2019-10-14T15:43:58.000Z | 2019-10-15T22:26:17.000Z | c10r/template_file.py | Teppen-io/c10r | e386d0ef9fed76118c0063185c61f182d56d9f5b | [
"MIT"
] | null | null | null | c10r/template_file.py | Teppen-io/c10r | e386d0ef9fed76118c0063185c61f182d56d9f5b | [
"MIT"
] | 1 | 2021-10-21T04:49:51.000Z | 2021-10-21T04:49:51.000Z | import os
from string import Template
class TemplateFile:
def __init__(self, fpath, config, row={}):
self._file = fpath
self._row = row
self._config = config
@property
def _mtime(self):
return int(self._row.get(self._config['mtime'], 0))
@property
def _template(se... | 26 | 90 | 0.604746 |
f60ce37170e48e1b0d3cc58a9c820b0c9fd5c02c | 146 | py | Python | hyperJob/vacancy/apps.py | klilax/JobAgency | d26e5b09ac4dea6460813b1d2632fef6ba1066af | [
"MIT"
] | null | null | null | hyperJob/vacancy/apps.py | klilax/JobAgency | d26e5b09ac4dea6460813b1d2632fef6ba1066af | [
"MIT"
] | null | null | null | hyperJob/vacancy/apps.py | klilax/JobAgency | d26e5b09ac4dea6460813b1d2632fef6ba1066af | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class VacancyConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'vacancy'
| 20.857143 | 56 | 0.760274 |
6a25b1ed077b296dc23d947383ad0676bd1705e5 | 15,247 | py | Python | tw2/jit/widgets/sqla.py | toscawidgets/tw2.jit | c5e8059975115385f225029ba5c7380673524122 | [
"MIT"
] | 1 | 2020-01-12T05:11:24.000Z | 2020-01-12T05:11:24.000Z | tw2/jit/widgets/sqla.py | toscawidgets/tw2.jit | c5e8059975115385f225029ba5c7380673524122 | [
"MIT"
] | null | null | null | tw2/jit/widgets/sqla.py | toscawidgets/tw2.jit | c5e8059975115385f225029ba5c7380673524122 | [
"MIT"
] | null | null | null | import tw2.core as twc
from tw2.core.resources import JSSymbol
from tw2.core.util import name2label
from tw2.jit.widgets.ajax import AjaxRadialGraph
# Used for doing ajax stuff
import tw2.jquery
import urllib
import sqlalchemy as sa
from hashlib import md5
from itertools import product
from BeautifulSoup import Beau... | 40.76738 | 90 | 0.513872 |
9d1fc7df2b2947102056efa659658b24d9d13606 | 172 | py | Python | lab/track-sale-sms-lab/utils.py | capitalch/trace | 530893ae212b1809b2785c4ba01c538e10ecc2fc | [
"Apache-2.0"
] | null | null | null | lab/track-sale-sms-lab/utils.py | capitalch/trace | 530893ae212b1809b2785c4ba01c538e10ecc2fc | [
"Apache-2.0"
] | 35 | 2020-05-22T03:09:09.000Z | 2021-04-22T18:10:46.000Z | lab/track-sale-sms-lab/utils.py | capitalch/trace | 530893ae212b1809b2785c4ba01c538e10ecc2fc | [
"Apache-2.0"
] | null | null | null | import json
def get_config():
config_data = None
with open('config.json','r') as config_file:
config_data= json.load(config_file)
return(config_data)
| 21.5 | 49 | 0.680233 |
548f6c3725d943ee4e34f401dbd0fcb450145383 | 5,461 | py | Python | lte/gateway/python/integ_tests/s1aptests/test_attach_detach_dedicated_looped.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 849 | 2020-07-17T09:15:03.000Z | 2022-03-31T17:11:52.000Z | lte/gateway/python/integ_tests/s1aptests/test_attach_detach_dedicated_looped.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 8,386 | 2020-06-23T23:35:30.000Z | 2022-03-31T23:31:28.000Z | lte/gateway/python/integ_tests/s1aptests/test_attach_detach_dedicated_looped.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 406 | 2020-06-28T17:02:35.000Z | 2022-03-31T22:03:55.000Z | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 35.69281 | 78 | 0.517121 |
82f2a6dcc644569354ca2abf5c1eeaa7b1895ae5 | 26,669 | py | Python | test/functional/p2p_sendheaders.py | bitcoinpaythrough-project/bitcoinpaythrough | 2aabe233abf16ec4e41be4c0528204b7a479dbd3 | [
"MIT"
] | null | null | null | test/functional/p2p_sendheaders.py | bitcoinpaythrough-project/bitcoinpaythrough | 2aabe233abf16ec4e41be4c0528204b7a479dbd3 | [
"MIT"
] | null | null | null | test/functional/p2p_sendheaders.py | bitcoinpaythrough-project/bitcoinpaythrough | 2aabe233abf16ec4e41be4c0528204b7a479dbd3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test behavior of headers messages to announce blocks.
Setup:
- Two nodes:
- node0 is the node-und... | 43.93575 | 154 | 0.640519 |
4e96c5dfa1c47ac19230b00f0696ac9cfdee248e | 299 | py | Python | advanced/part11-05_remove_smaller_than/src/remove_smaller_than.py | Hannah-Abi/python-pro-21 | 2ce32c4bf118054329d19afdf83c50561be1ada8 | [
"MIT"
] | null | null | null | advanced/part11-05_remove_smaller_than/src/remove_smaller_than.py | Hannah-Abi/python-pro-21 | 2ce32c4bf118054329d19afdf83c50561be1ada8 | [
"MIT"
] | null | null | null | advanced/part11-05_remove_smaller_than/src/remove_smaller_than.py | Hannah-Abi/python-pro-21 | 2ce32c4bf118054329d19afdf83c50561be1ada8 | [
"MIT"
] | null | null | null | # WRITE YOUR SOLUTION HERE:
def remove_smaller_than(numbers: list, limit: int):
return [number for number in numbers if number >= limit]
if __name__=="__main__":
numbers = [1,65, 32, -6, 9, 11]
print(remove_smaller_than(numbers, 10))
print(remove_smaller_than([-4, 7, 8, -100], 0)) | 33.222222 | 60 | 0.67893 |
89b7ac2de221fde6e470a90e6f6f0fb3aed26c4f | 8,000 | py | Python | trainer.py | JuanCarniglia/MachineLearning_Classification | 1f192d7111b3bcae6def6c5a18383f2508273d39 | [
"Apache-2.0"
] | 2 | 2017-11-28T20:00:21.000Z | 2021-02-18T08:06:12.000Z | trainer.py | JuanCarniglia/MachineLearning_Classification | 1f192d7111b3bcae6def6c5a18383f2508273d39 | [
"Apache-2.0"
] | null | null | null | trainer.py | JuanCarniglia/MachineLearning_Classification | 1f192d7111b3bcae6def6c5a18383f2508273d39 | [
"Apache-2.0"
] | 1 | 2017-11-27T22:36:24.000Z | 2017-11-27T22:36:24.000Z |
# Inport Helper Class - Dataset, to load all images
import dataset
# Inport Tensorflow
import tensorflow as tf
# Import Time and Timedelta, to get actual time lapse measurements
import time
from datetime import timedelta
# Import Math
import math
# Import Random
import random
# Import Numpy
import numpy as np
#... | 32.128514 | 148 | 0.695 |
d368ab6023d46cc3d69568dfc01b6e1cb716e510 | 13,312 | py | Python | modified_rdkit/Code/Geometry/Wrap/testGeometry.py | hjuinj/RDKit_mETKDG | b270e765caa61d289e9e33595d4264b156f9062e | [
"MIT"
] | 3 | 2020-03-30T04:00:52.000Z | 2021-05-31T01:32:13.000Z | modified_rdkit/Code/Geometry/Wrap/testGeometry.py | hjuinj/RDKit_mETKDG | b270e765caa61d289e9e33595d4264b156f9062e | [
"MIT"
] | 1 | 2020-05-23T17:31:04.000Z | 2020-05-26T06:52:47.000Z | modified_rdkit/Code/Geometry/Wrap/testGeometry.py | hjuinj/RDKit_mETKDG | b270e765caa61d289e9e33595d4264b156f9062e | [
"MIT"
] | 4 | 2020-03-30T04:00:53.000Z | 2021-02-25T23:11:52.000Z |
import os, sys
import unittest
import copy
import math
import pickle
from rdkit import RDConfig
from rdkit import DataStructs
from rdkit.Geometry import rdGeometry as geom
def feq(v1, v2, tol=1.0e-4):
return abs(v1 - v2) < tol
class TestCase(unittest.TestCase):
def setUp(self):
pass
def test1aPoint3D... | 32.547677 | 96 | 0.620718 |
1893774cb1b26c20a779736bed4fe0f44879aa74 | 2,810 | py | Python | bibliopixel/project/recurse.py | rec/leds | ed5fd11ed155e7008d4ef6d5b3d82cd7f8b3ed6a | [
"MIT"
] | 253 | 2015-01-03T23:17:57.000Z | 2021-12-14T02:31:08.000Z | bibliopixel/project/recurse.py | rec/leds | ed5fd11ed155e7008d4ef6d5b3d82cd7f8b3ed6a | [
"MIT"
] | 879 | 2015-01-11T16:07:25.000Z | 2021-12-10T16:24:31.000Z | bibliopixel/project/recurse.py | rec/leds | ed5fd11ed155e7008d4ef6d5b3d82cd7f8b3ed6a | [
"MIT"
] | 71 | 2015-01-04T01:02:47.000Z | 2022-03-25T18:30:10.000Z | from . import construct, load
"""
In order to validate project descriptions, we need to recurse through project
dictionaries before we actually construct the objects in them.
Some fields of project dictionaries are designated to be "type constructors" -
i.e. they describe how to create an object. We need to recurse ... | 37.466667 | 78 | 0.662278 |
6df89950d1e4b220d4de6cd2de6995e877df6c17 | 4,370 | py | Python | Handloom-Design-Generation-using-Deep-Neural-Networks/preliminary work/Perceptual Loss Style transfer - rajat/Final Script/train.py | rajatkb/Handloom-Design-Generation-using-Deep-Neural-Networks | a4a708da4751796896ae8c9126d6c7d91a91a391 | [
"MIT"
] | 14 | 2018-12-29T14:03:45.000Z | 2021-06-07T19:25:31.000Z | Handloom-Design-Generation-using-Deep-Neural-Networks/preliminary work/Perceptual Loss Style transfer - rajat/Final Script/.ipynb_checkpoints/train-checkpoint.py | rajatkb/Handloom-Design-Generation-using-Deep-Neural-Networks | a4a708da4751796896ae8c9126d6c7d91a91a391 | [
"MIT"
] | 14 | 2020-09-04T21:37:41.000Z | 2022-03-02T04:04:47.000Z | Handloom-Design-Generation-using-Deep-Neural-Networks/preliminary work/Perceptual Loss Style transfer - rajat/Final Script/.ipynb_checkpoints/train-checkpoint.py | rajatkb/Handloom-Design-Generation-using-Deep-Neural-Networks | a4a708da4751796896ae8c9126d6c7d91a91a391 | [
"MIT"
] | 4 | 2018-12-26T07:07:26.000Z | 2020-01-18T13:52:52.000Z | from keras.backend.tensorflow_backend import set_session
import tensorflow as tf
config = tf.ConfigProto()
config.gpu_options.allow_growth = True # dynamically grow the memory used on the GPU
config.log_device_placement = True # to log device placement (on which device the operation ran)
sess = tf.Session(config=con... | 32.132353 | 130 | 0.67849 |
4316ec58660b902004e380bd39b06c8754dd25d2 | 1,360 | py | Python | locallibrary/urls.py | hfroot/abolitionist-library | de65c3ff85d927a4550cfbc073ff616743b555ec | [
"CC0-1.0"
] | null | null | null | locallibrary/urls.py | hfroot/abolitionist-library | de65c3ff85d927a4550cfbc073ff616743b555ec | [
"CC0-1.0"
] | null | null | null | locallibrary/urls.py | hfroot/abolitionist-library | de65c3ff85d927a4550cfbc073ff616743b555ec | [
"CC0-1.0"
] | null | null | null | """locallibrary URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 30.222222 | 82 | 0.744853 |
9b288fedd7137f455956e9e5e462ae57fb9afa59 | 713 | py | Python | link_extractor/get_soup.py | gaoyunzhi/link_extractor | 042a1c35efdf58b60fa6b30bc8c5ca03695b6e17 | [
"MIT"
] | 1 | 2021-01-15T14:08:34.000Z | 2021-01-15T14:08:34.000Z | link_extractor/get_soup.py | gaoyunzhi/link_extractor | 042a1c35efdf58b60fa6b30bc8c5ca03695b6e17 | [
"MIT"
] | null | null | null | link_extractor/get_soup.py | gaoyunzhi/link_extractor | 042a1c35efdf58b60fa6b30bc8c5ca03695b6e17 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
import cached_url
from telegram_util import matchKey
offtopic_tags = ['nav', 'footer', 'aside', 'header']
try:
credential = yaml.load('credential', Loader=yaml.FullLoader)
except:
credential = {}
def getSoup(site):
if 'douban.' in site and 'douban_cookie' in credential:
option = {'c... | 28.52 | 66 | 0.715288 |
43a8a67257b478cc25b3b85985e4ba982942f55c | 8,943 | py | Python | Pitch Generator/Pitch_Generator.py | alexissoto1/AudioNerd.py | 107b7eb8a141994798eb10075e8591491ca9b471 | [
"MIT"
] | null | null | null | Pitch Generator/Pitch_Generator.py | alexissoto1/AudioNerd.py | 107b7eb8a141994798eb10075e8591491ca9b471 | [
"MIT"
] | null | null | null | Pitch Generator/Pitch_Generator.py | alexissoto1/AudioNerd.py | 107b7eb8a141994798eb10075e8591491ca9b471 | [
"MIT"
] | null | null | null | #Python 3.5
import numpy as np
import simpleaudio as sa
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
Range = list(range(20, 20000))
class Generator(object):
def __init__(self,root):
self.root = root
root.title('Pitch Generator')
root.resizable(False, False... | 36.954545 | 126 | 0.581237 |
30b76be1bfc68c62bc395f6060014920f2fba1c7 | 573 | py | Python | arekit/contrib/networks/features/utils.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 18 | 2019-12-14T18:43:11.000Z | 2022-03-21T05:55:36.000Z | arekit/contrib/networks/features/utils.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 284 | 2020-08-08T20:52:44.000Z | 2022-03-31T05:26:20.000Z | arekit/contrib/networks/features/utils.py | nicolay-r/AREk | 19c39ec0dc9a17464cade03b9c4da0c6d1d21191 | [
"MIT"
] | 1 | 2021-08-07T13:17:43.000Z | 2021-08-07T13:17:43.000Z | import numpy as np
def in_window(window_begin, window_end, ind):
return window_begin <= ind < window_end
def pad_right_inplace(lst, pad_size, filler):
assert(pad_size - len(lst) > 0)
lst.extend([filler] * (pad_size - len(lst)))
def pad_right_or_crop_inplace(lst, pad_size, filler):
if len(lst) < ... | 19.758621 | 53 | 0.689354 |
f6d47e897bd57a15fe18a22088cf2a96efe530d8 | 3,455 | py | Python | gibson2/test/test_pbr.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | 3 | 2021-02-07T14:00:38.000Z | 2021-07-03T19:40:59.000Z | gibson2/test/test_pbr.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | null | null | null | gibson2/test/test_pbr.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | 2 | 2021-04-01T12:14:59.000Z | 2021-06-18T13:04:39.000Z | from gibson2.render.mesh_renderer.mesh_renderer_cpu import MeshRenderer
from gibson2.render.mesh_renderer.mesh_renderer_settings import MeshRendererSettings
import numpy as np
import os
import gibson2
import GPUtil
import time
from gibson2.utils.assets_utils import download_assets
from gibson2.utils.assets_utils import... | 46.066667 | 135 | 0.678148 |
b88ea4b426f11fbf36ce97a20af2c686140bf189 | 454 | py | Python | lcd_demo.py | Pratt-Institute/info697 | 7821ae3eca58344ee510058d42b3889ce18edc2f | [
"MIT"
] | 3 | 2020-02-11T21:06:12.000Z | 2020-02-11T22:45:41.000Z | lcd_demo.py | Pratt-Institute/info697 | 7821ae3eca58344ee510058d42b3889ce18edc2f | [
"MIT"
] | null | null | null | lcd_demo.py | Pratt-Institute/info697 | 7821ae3eca58344ee510058d42b3889ce18edc2f | [
"MIT"
] | 3 | 2020-02-14T17:15:45.000Z | 2020-02-25T10:07:14.000Z | # Adapted from:
# https://github.com/shaoziyang/microbit-lib/tree/master/lcd/I2C_LCD1602
from mb_i2c_lcd1602 import *
lcd=LCD1620()
while True:
# Print to both lines of LCD
lcd.puts('Hello', 0, 0)
lcd.puts('World!', 1, 5)
sleep(1000)
# Clear screen
lcd.clear()
sleep(1000)
# Turn backl... | 18.916667 | 72 | 0.640969 |
46bbd490f198d92d404b4eb68c3834cc06c1891a | 2,347 | py | Python | backend/objectiv_backend/schema/hydrate_events.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | 23 | 2021-11-10T21:37:42.000Z | 2022-03-30T11:46:19.000Z | backend/objectiv_backend/schema/hydrate_events.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | 163 | 2021-11-10T10:11:26.000Z | 2022-03-31T16:04:27.000Z | backend/objectiv_backend/schema/hydrate_events.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2021 Objectiv B.V.
"""
import argparse
import json
import sys
from typing import List
from objectiv_backend.schema.event_schemas import EventSchema, get_event_schema
from objectiv_backend.schema.validate_events import validate_event_list
from objectiv_backend.common.types import EventData
def hydrate_t... | 36.107692 | 105 | 0.699617 |
c435b2422b294dcd7a98469926d1f60e9b038f6f | 1,107 | py | Python | ciw/individual.py | CiwPython/Ciw | 8d5978108f797a6c3e42d8f70f31510f889f2dd0 | [
"MIT"
] | 107 | 2016-11-18T22:44:58.000Z | 2022-03-29T01:38:12.000Z | ciw/individual.py | CiwPython/Ciw | 8d5978108f797a6c3e42d8f70f31510f889f2dd0 | [
"MIT"
] | 117 | 2016-09-25T19:12:39.000Z | 2022-03-31T14:01:47.000Z | ciw/individual.py | CiwPython/Ciw | 8d5978108f797a6c3e42d8f70f31510f889f2dd0 | [
"MIT"
] | 34 | 2016-12-21T12:04:29.000Z | 2022-03-29T10:46:29.000Z | from __future__ import division
class Individual(object):
"""
Class for an individual.
"""
def __init__(self, id_number, customer_class=0, priority_class=0, simulation=False):
"""
Initialise an individual.
"""
self.arrival_date = False
self.service_start_date = F... | 31.628571 | 88 | 0.63234 |
606852222da055a286c18a612babaf54c9f8161a | 6,210 | py | Python | examples/python/balance_group_sat.py | AlohaChina/or-tools | 1ece0518104db435593a1a21882801ab6ada3e15 | [
"Apache-2.0"
] | 8,273 | 2015-02-24T22:10:50.000Z | 2022-03-31T21:19:27.000Z | examples/python/balance_group_sat.py | AlohaChina/or-tools | 1ece0518104db435593a1a21882801ab6ada3e15 | [
"Apache-2.0"
] | 2,530 | 2015-03-05T04:27:21.000Z | 2022-03-31T06:13:02.000Z | examples/python/balance_group_sat.py | AlohaChina/or-tools | 1ece0518104db435593a1a21882801ab6ada3e15 | [
"Apache-2.0"
] | 2,057 | 2015-03-04T15:02:02.000Z | 2022-03-30T02:29:27.000Z | # Copyright 2010-2021 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... | 34.5 | 84 | 0.613366 |
edf379e66a067907393ab0803b682e49550b6640 | 1,836 | py | Python | plugins/stock.py | bunburya/bunbot | 35b89a4bc4598356eac556835e9595ab1f16137c | [
"MIT"
] | 1 | 2016-08-09T21:28:41.000Z | 2016-08-09T21:28:41.000Z | plugins/stock.py | bunburya/bunbot | 35b89a4bc4598356eac556835e9595ab1f16137c | [
"MIT"
] | null | null | null | plugins/stock.py | bunburya/bunbot | 35b89a4bc4598356eac556835e9595ab1f16137c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from sys import argv
from urllib.request import urlopen
from urllib.parse import urlencode
from urllib.error import URLError
import re
BASE_URL = 'http://finance.yahoo.com/d/quotes.csv?'
FORMAT = ['s', 'l1', 'c']
INDEX = {'NASDAQ': '^IXIC', 'S&P': '^GSPC'}
class Plugin:
def __init__(self... | 30.6 | 77 | 0.547386 |
24a9c49c001dfdab71d22b5a0b91f2cb837f676e | 2,810 | py | Python | test/test_helpers.py | synodriver/asgi-webdav | 303d842774ff3082f06e828c3858d9b9e2a64b86 | [
"MIT"
] | 38 | 2021-03-25T06:33:07.000Z | 2022-03-11T03:56:15.000Z | test/test_helpers.py | synodriver/asgi-webdav | 303d842774ff3082f06e828c3858d9b9e2a64b86 | [
"MIT"
] | 15 | 2021-05-19T03:24:51.000Z | 2022-03-25T22:40:02.000Z | test/test_helpers.py | synodriver/asgi-webdav | 303d842774ff3082f06e828c3858d9b9e2a64b86 | [
"MIT"
] | 8 | 2021-03-29T06:59:34.000Z | 2022-03-11T03:56:17.000Z | from pathlib import Path
import pytest
from asgi_webdav.constants import AppArgs
from asgi_webdav.helpers import guess_type, detect_charset, is_browser_user_agent
from asgi_webdav.config import get_config
def test_guess_type():
config = get_config()
config.update_from_app_args_and_env_and_default_value(
... | 31.931818 | 143 | 0.697153 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.