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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3b2a99b7dc2c09c8596c0f28ca4318b474d9d158 | 11,696 | py | Python | mythic-docker/app/api/event_message_api.py | xorrior/Mythic | ea348b66e1d96e88e0e7fbabff182945cbdf12b6 | [
"BSD-3-Clause"
] | 2 | 2021-01-28T19:35:46.000Z | 2021-04-08T12:01:48.000Z | mythic-docker/app/api/event_message_api.py | xorrior/Mythic | ea348b66e1d96e88e0e7fbabff182945cbdf12b6 | [
"BSD-3-Clause"
] | null | null | null | mythic-docker/app/api/event_message_api.py | xorrior/Mythic | ea348b66e1d96e88e0e7fbabff182945cbdf12b6 | [
"BSD-3-Clause"
] | 2 | 2021-06-23T18:59:18.000Z | 2021-08-20T00:06:49.000Z | from app import mythic, db_objects
from sanic.response import json
from sanic_jwt.decorators import scoped, inject_user
import app.database_models.model as db_model
from sanic.exceptions import abort
from math import ceil
from peewee import fn
from app.api.siem_logger import log_to_siem
async def get_old_event_alerts... | 39.918089 | 134 | 0.542322 |
355c729544b9a56d9817c179a4b4657efd8ca8a1 | 2,266 | py | Python | contrib/opencensus-ext-azure/examples/metrics/sum.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 650 | 2017-07-09T02:08:10.000Z | 2022-03-22T20:39:54.000Z | contrib/opencensus-ext-azure/examples/metrics/sum.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 735 | 2017-07-26T01:15:16.000Z | 2022-03-29T20:17:20.000Z | contrib/opencensus-ext-azure/examples/metrics/sum.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 256 | 2017-07-24T18:29:15.000Z | 2022-03-15T15:33:03.000Z | # Copyright 2019, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 35.968254 | 78 | 0.682259 |
7148797b4fa13c65c6b747f8df9f828115e90104 | 5,261 | py | Python | valohai_cli/models/project.py | valohai/valohai-cli | d45f4d8d3b39e803730c070a40f8d2ddfbfb661c | [
"MIT"
] | 11 | 2017-11-06T16:31:46.000Z | 2020-10-26T09:55:12.000Z | valohai_cli/models/project.py | valohai/valohai-cli | d45f4d8d3b39e803730c070a40f8d2ddfbfb661c | [
"MIT"
] | 147 | 2017-04-06T09:46:11.000Z | 2022-03-10T16:24:15.000Z | valohai_cli/models/project.py | valohai/valohai-cli | d45f4d8d3b39e803730c070a40f8d2ddfbfb661c | [
"MIT"
] | 4 | 2017-04-16T16:00:51.000Z | 2021-07-05T11:36:36.000Z | import io
import os
from typing import List, Optional, TextIO, Union
import valohai_yaml
from click import BadParameter
from valohai_yaml.objs.config import Config
from valohai_cli.api import request
from valohai_cli.exceptions import APIError, InvalidConfig, NoExecution
from valohai_cli.git import get_file_at_commit... | 36.534722 | 119 | 0.588101 |
8d9b5f00362d8e0186852c8c1afba18e8792d44c | 2,694 | py | Python | tests/test_git_command.py | Orchild/git-repo | a46bf7dc2af111ae4a663d61ed06dc90ddfb8068 | [
"Apache-2.0"
] | null | null | null | tests/test_git_command.py | Orchild/git-repo | a46bf7dc2af111ae4a663d61ed06dc90ddfb8068 | [
"Apache-2.0"
] | null | null | null | tests/test_git_command.py | Orchild/git-repo | a46bf7dc2af111ae4a663d61ed06dc90ddfb8068 | [
"Apache-2.0"
] | 2 | 2019-08-12T22:30:01.000Z | 2019-10-27T10:06:06.000Z | # -*- coding:utf-8 -*-
#
# Copyright 2019 The Android Open Source Project
#
# 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 requir... | 34.101266 | 77 | 0.702673 |
0985cf75af6e813b5d41f1b47bdc93ca1762a436 | 1,782 | py | Python | tests/test_html.py | BigSmitty72/FFballPython | 8dd15d2753ce9df59b6e4393629eb065f8e5e304 | [
"BSD-3-Clause"
] | null | null | null | tests/test_html.py | BigSmitty72/FFballPython | 8dd15d2753ce9df59b6e4393629eb065f8e5e304 | [
"BSD-3-Clause"
] | null | null | null | tests/test_html.py | BigSmitty72/FFballPython | 8dd15d2753ce9df59b6e4393629eb065f8e5e304 | [
"BSD-3-Clause"
] | null | null | null | import mechanize
from bs4 import BeautifulSoup, SoupStrainer
import re
league = "70928"
season = "2016"
def standings_html():
url = UrlConstants.STANDINGS_URL.format(league, season)
return get_html(url)
def standings_detail_html():
url = UrlConstants.STANDINGS_URL.format(league, season)
return get_... | 29.213115 | 100 | 0.723906 |
511a33391498ae1937a069c4b5afa80b4a34bf9e | 3,012 | py | Python | models/SCC_Model/CSRNet.py | Yuuchuin/C3_V2 | 92a5edbc2c2b3452c5f57e74f928591192293e81 | [
"MIT"
] | 1 | 2021-01-29T09:43:05.000Z | 2021-01-29T09:43:05.000Z | models/SCC_Model/CSRNet.py | Yuuchuin/C3_V2 | 92a5edbc2c2b3452c5f57e74f928591192293e81 | [
"MIT"
] | null | null | null | models/SCC_Model/CSRNet.py | Yuuchuin/C3_V2 | 92a5edbc2c2b3452c5f57e74f928591192293e81 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch
from torchvision import models
import torch.nn.functional as F
from .SCC_BaseModel import SCC_BaseModel
from torch import optim
from torch.optim.lr_scheduler import StepLR
class csrnet(nn.Module):
def __init__(self, load_weights=False):
super(csrnet, self).__init__()
... | 35.857143 | 101 | 0.597278 |
1f578b742ccd924cc07a04a34fc4894fa54d766b | 399 | py | Python | Constants.py | r-soltani/BreachAnalyzer | 15c1cde1e068e4f1e0d77393e82a5034bb3d045b | [
"Apache-2.0"
] | null | null | null | Constants.py | r-soltani/BreachAnalyzer | 15c1cde1e068e4f1e0d77393e82a5034bb3d045b | [
"Apache-2.0"
] | null | null | null | Constants.py | r-soltani/BreachAnalyzer | 15c1cde1e068e4f1e0d77393e82a5034bb3d045b | [
"Apache-2.0"
] | null | null | null |
# data retreival parameters
# number of days from the incident date
STOCK_PRICE_TARGET_DAYS_DELTA_BEFORE = 7
# number of days prior to incident date
STOCK_PRICE_TARGET_DAYS_DELTA_AFTER = 14
STOCK_PRICE_TARGET_DAYS_DELTA_INTERVAL = 1
# price change reference (NASDAQ)
NASDAQ_TICKER = "NDAQ"
# AlphaAdvantage API Key
... | 19.95 | 42 | 0.807018 |
72840d2036585d7b83b2266ffabf1bb5ba349211 | 1,693 | py | Python | built-in/TensorFlow/Official/cv/image_classification/ResnetVariant_for_TensorFlow/automl/evaluate_service/config.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/TensorFlow/Official/cv/image_classification/ResnetVariant_for_TensorFlow/automl/evaluate_service/config.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/TensorFlow/Official/cv/image_classification/ResnetVariant_for_TensorFlow/automl/evaluate_service/config.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | # coding=utf-8
# Copyright 2018 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 requ... | 43.410256 | 109 | 0.692853 |
34a58fce5e908f69fe01dc9307aab161407d7cb3 | 1,694 | py | Python | script/upload-checksums.py | rprichard/atom-shell | 73ee24bd98ff40a0bbde1fe1bbbf74ff9a91a5d5 | [
"MIT"
] | 2 | 2020-01-05T10:34:24.000Z | 2020-01-05T10:40:00.000Z | script/upload-checksums.py | rprichard/atom-shell | 73ee24bd98ff40a0bbde1fe1bbbf74ff9a91a5d5 | [
"MIT"
] | null | null | null | script/upload-checksums.py | rprichard/atom-shell | 73ee24bd98ff40a0bbde1fe1bbbf74ff9a91a5d5 | [
"MIT"
] | 3 | 2015-04-19T04:09:08.000Z | 2021-09-19T19:02:32.000Z | #!/usr/bin/env python
import argparse
import hashlib
import os
import tempfile
from lib.util import download, rm_rf, s3_config, s3put
DIST_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/'
def main():
args = parse_args()
url = DIST_URL + args.version + '/'
directory, files = download_f... | 23.859155 | 75 | 0.673554 |
001e78bd7dfc2cf90a87ffacf21ef810e5b8aaf2 | 13,942 | py | Python | network/anynet.py | pandamax/carrier-of-tricks-for-classification-pytorch | 4c29088b113aea4b6308fb9935243276233f3763 | [
"MIT"
] | 84 | 2020-06-24T16:01:22.000Z | 2022-02-24T05:17:51.000Z | network/anynet.py | hoya012/bag-of-tricks-for-classification-pytorch | d788d7a4e5007da9c410bdd3ef7ce3766d2ba0cd | [
"MIT"
] | 1 | 2021-05-31T07:33:37.000Z | 2021-05-31T07:33:37.000Z | network/anynet.py | hoya012/bag-of-tricks-for-classification-pytorch | d788d7a4e5007da9c410bdd3ef7ce3766d2ba0cd | [
"MIT"
] | 15 | 2020-07-09T15:49:33.000Z | 2021-10-21T11:01:07.000Z | #!/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.
"""AnyNet models."""
import torch
import torch.nn as nn
import math
import os
def init_weights(m):
"""Performs Re... | 33.434053 | 111 | 0.581982 |
08588e8207155a6821ba8a51db8716daf0e00080 | 58,781 | py | Python | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/drt/DRT.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/drt/DRT.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/drt/DRT.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null | from nltk.internals import Counter
from Tkinter import Canvas
from Tkinter import Tk
from tkFont import Font
from nltk.sem import logic
class Error(Exception): pass
def unique_variable(counter=None):
if counter is None: counter = DRS._counter
unique = counter.get()
return VariableExpression(Variable('z'+s... | 38.318774 | 192 | 0.578316 |
ded6f61d36a2c727d22cd5be279481a79c981a80 | 5,119 | py | Python | excut/kg/kg_indexing.py | mhmgad/ExCut | 09e943a23207381de3c3a9e6f70015882b8ec4af | [
"Apache-2.0"
] | 5 | 2020-11-17T19:59:49.000Z | 2021-09-23T23:10:39.000Z | excut/kg/kg_indexing.py | mhmgad/ExCut | 09e943a23207381de3c3a9e6f70015882b8ec4af | [
"Apache-2.0"
] | null | null | null | excut/kg/kg_indexing.py | mhmgad/ExCut | 09e943a23207381de3c3a9e6f70015882b8ec4af | [
"Apache-2.0"
] | null | null | null | import math
import numpy as np
from SPARQLWrapper import SPARQLWrapper, JSON, POST
from rdflib import Graph
from rdflib import URIRef
from excut.kg.utils import data_formating
from excut.utils.logging import logger
from excut.kg.utils.data_formating import entity_full_url, relation_full_url
from excut.kg.kg_triples_s... | 36.049296 | 116 | 0.635866 |
979ae0c9e19d7f69b6331cf81be8c39fa371c9ce | 3,050 | py | Python | tests/integration/test_main.py | RobbeSneyders/openapi-spec-validator | 04f30172e1e6bb03b77a154fc95e1283495ea8ed | [
"Apache-2.0"
] | null | null | null | tests/integration/test_main.py | RobbeSneyders/openapi-spec-validator | 04f30172e1e6bb03b77a154fc95e1283495ea8ed | [
"Apache-2.0"
] | null | null | null | tests/integration/test_main.py | RobbeSneyders/openapi-spec-validator | 04f30172e1e6bb03b77a154fc95e1283495ea8ed | [
"Apache-2.0"
] | null | null | null | import pytest
from io import StringIO
from openapi_spec_validator.__main__ import main
from unittest import mock
def test_schema_default():
"""Test default schema is 3.0.0"""
testargs = ['./tests/integration/data/v3.0/petstore.yaml']
main(testargs)
def test_schema_v3():
"""No errors when calling p... | 30.19802 | 74 | 0.664262 |
4bf5b9c072ffae1ef2a97fc649387cc1e024449b | 15,782 | py | Python | geoportal/tests/functional/test_themes_time.py | rbovard/c2cgeoportal | 61b7a4fc98f686f9b7d4c5fda7bb4c5cc09f8de8 | [
"BSD-2-Clause-FreeBSD"
] | 43 | 2015-02-16T06:56:25.000Z | 2021-09-12T17:49:16.000Z | geoportal/tests/functional/test_themes_time.py | rbovard/c2cgeoportal | 61b7a4fc98f686f9b7d4c5fda7bb4c5cc09f8de8 | [
"BSD-2-Clause-FreeBSD"
] | 3,227 | 2015-01-05T10:30:59.000Z | 2022-03-31T03:25:39.000Z | geoportal/tests/functional/test_themes_time.py | rbovard/c2cgeoportal | 61b7a4fc98f686f9b7d4c5fda7bb4c5cc09f8de8 | [
"BSD-2-Clause-FreeBSD"
] | 57 | 2015-01-29T08:32:12.000Z | 2022-03-16T07:07:33.000Z | # Copyright (c) 2013-2019, Camptocamp SA
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions an... | 43.961003 | 127 | 0.479534 |
a63f0ab1248ff1fee17b0eb537c9e5cafac30672 | 2,942 | py | Python | src/models/layers/pool2d_same.py | Alicegaz/torchok | 7b8f95df466a25b1ad8ee93bed1a3c7516440cf4 | [
"Apache-2.0"
] | 8 | 2021-10-12T05:39:20.000Z | 2022-03-31T10:55:01.000Z | src/models/layers/pool2d_same.py | Alicegaz/torchok | 7b8f95df466a25b1ad8ee93bed1a3c7516440cf4 | [
"Apache-2.0"
] | 1 | 2022-03-30T19:23:42.000Z | 2022-03-30T19:23:42.000Z | src/models/layers/pool2d_same.py | Alicegaz/torchok | 7b8f95df466a25b1ad8ee93bed1a3c7516440cf4 | [
"Apache-2.0"
] | 5 | 2021-11-17T07:38:28.000Z | 2022-01-31T10:46:36.000Z | """ AvgPool2d w/ Same Padding
Hacked together by / Copyright 2020 Ross Wightman
"""
from typing import List
import torch.nn as nn
import torch.nn.functional as F
from .helpers import to_2tuple
from .padding import pad_same, get_padding_value
def avg_pool2d_same(x, kernel_size: List[int], stride: List[int], padding... | 39.756757 | 118 | 0.680489 |
faf177217324f725290d60a1cefe9fc1930b55fc | 13,048 | py | Python | tools/run-dev.py | rohanj-02/zulip | fc0488fdb1b83bffea4a300656d7bb7f5e6ab581 | [
"Apache-2.0"
] | 2 | 2020-11-12T12:28:46.000Z | 2020-11-16T11:17:46.000Z | tools/run-dev.py | rohanj-02/zulip | fc0488fdb1b83bffea4a300656d7bb7f5e6ab581 | [
"Apache-2.0"
] | null | null | null | tools/run-dev.py | rohanj-02/zulip | fc0488fdb1b83bffea4a300656d7bb7f5e6ab581 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
import os
import pwd
import signal
import subprocess
import sys
from typing import Any, Callable, Generator, List, Sequence
from urllib.parse import urlunparse
# check for the venv
from lib import sanity_check
sanity_check.check_venv(__file__)
from tornado import gen, httpclien... | 30.846336 | 99 | 0.647379 |
a6f81b46c8b717bf9fb36f8c5ed31ec53aebe7c1 | 10,446 | py | Python | workBousaiOSA_baseline/predflowio/predflowio_PCRNB.py | deepkashiwa20/DeepCrowd | 847bcc20ca36b521eead4ededa5d11b2fd2af30a | [
"MIT"
] | 4 | 2021-09-07T09:29:43.000Z | 2022-03-28T07:18:16.000Z | workBousaiOSA_baseline/predflowio/predflowio_PCRNB.py | deepkashiwa20/DeepCrowd | 847bcc20ca36b521eead4ededa5d11b2fd2af30a | [
"MIT"
] | null | null | null | workBousaiOSA_baseline/predflowio/predflowio_PCRNB.py | deepkashiwa20/DeepCrowd | 847bcc20ca36b521eead4ededa5d11b2fd2af30a | [
"MIT"
] | 2 | 2021-06-18T01:28:16.000Z | 2021-08-10T01:24:49.000Z | import sys
import shutil
import os
import time
from datetime import datetime, date, timedelta
import pandas as pd
import numpy as np
import h5py
from copy import copy
from keras.models import load_model, Model, Sequential
from keras.layers import Input, Activation, Flatten, Dense,Reshape, Concatenate, Add, Lambda, Laye... | 38.977612 | 144 | 0.608367 |
565afb4674211785b6674fcefba571a818546b71 | 437 | py | Python | env/Lib/site-packages/plotly/validators/mesh3d/_text.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/mesh3d/_text.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/mesh3d/_text.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="text", parent_name="mesh3d", **kwargs):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
array_ok... | 33.615385 | 75 | 0.654462 |
b233487d2c9d4366fd73eb20689f90b8f8a283a2 | 4,743 | py | Python | cli/sawtooth_cli/state.py | RomarQ/sawtooth-core | b900f4f3a2ffda9f6fb32a57fd4eacc41be86e5a | [
"Apache-2.0"
] | null | null | null | cli/sawtooth_cli/state.py | RomarQ/sawtooth-core | b900f4f3a2ffda9f6fb32a57fd4eacc41be86e5a | [
"Apache-2.0"
] | null | null | null | cli/sawtooth_cli/state.py | RomarQ/sawtooth-core | b900f4f3a2ffda9f6fb32a57fd4eacc41be86e5a | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 34.875 | 80 | 0.622602 |
9c4e5de475a980293124a0b784d2c7d5cddd8208 | 902 | py | Python | security_monkey/common/gcp/error.py | boladmin/security_monkey | c28592ffd518fa399527d26262683fc860c30eef | [
"Apache-2.0"
] | 4,258 | 2015-01-04T22:06:10.000Z | 2022-03-31T23:40:27.000Z | security_monkey/common/gcp/error.py | boladmin/security_monkey | c28592ffd518fa399527d26262683fc860c30eef | [
"Apache-2.0"
] | 1,013 | 2015-01-12T02:31:03.000Z | 2021-09-16T19:09:03.000Z | security_monkey/common/gcp/error.py | boladmin/security_monkey | c28592ffd518fa399527d26262683fc860c30eef | [
"Apache-2.0"
] | 965 | 2015-01-11T21:06:07.000Z | 2022-03-17T16:53:57.000Z | # Copyright 2017 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 31.103448 | 78 | 0.689579 |
f4cc7970deabec9a4ef78af780eca0d298c0bb5f | 556 | py | Python | functional_tests/prodigy/prodigy_connect.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | 3,968 | 2017-08-23T21:27:19.000Z | 2022-03-31T22:00:19.000Z | functional_tests/prodigy/prodigy_connect.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | 2,725 | 2017-04-17T00:29:15.000Z | 2022-03-31T21:01:53.000Z | functional_tests/prodigy/prodigy_connect.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | 351 | 2018-04-08T19:39:34.000Z | 2022-03-30T19:38:08.000Z | import json
# Monkey patch Prodigy dataset loading for testing
# Would bypass the requirement to maintain local database for storing Prodigy files.
class Database:
def get_dataset(self, dataset):
# load sample dataset in JSON format
file_name = dataset + ".json"
with open('prodigy_test_r... | 23.166667 | 84 | 0.647482 |
f2b54c23d46cee15ff4350d6c19a6c30d12d0047 | 1,115 | py | Python | api_test/users/tests/test_forms.py | withyeah/cre | da1904fdb09aec1c9206ab2b3a8e34856df08b9a | [
"MIT"
] | null | null | null | api_test/users/tests/test_forms.py | withyeah/cre | da1904fdb09aec1c9206ab2b3a8e34856df08b9a | [
"MIT"
] | 12 | 2020-06-05T23:55:17.000Z | 2022-03-12T00:02:20.000Z | api_test/users/tests/test_forms.py | withyeah/cre | da1904fdb09aec1c9206ab2b3a8e34856df08b9a | [
"MIT"
] | null | null | null | import pytest
from api_test.users.forms import UserCreationForm
from api_test.users.tests.factories import UserFactory
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
def test_clean_username(self):
# A user with proto_user params does not exist yet.
proto_user = UserFactory.build(... | 27.195122 | 59 | 0.593722 |
17a3145cecb9ddc873348a343919a42d9f48afeb | 1,310 | py | Python | third_party/NW Script Tools/Selection Tools/NW Select Previous Object in Manager.py | n1ckfg/C4DToolbox | 3c23a83ee31e09c4faf0c05933fd491017f30aef | [
"MIT"
] | 9 | 2015-02-02T21:26:15.000Z | 2021-05-21T01:38:21.000Z | third_party/NW Script Tools/Selection Tools/NW Select Previous Object in Manager.py | DreHit17/C4DToolbox | 3c23a83ee31e09c4faf0c05933fd491017f30aef | [
"MIT"
] | null | null | null | third_party/NW Script Tools/Selection Tools/NW Select Previous Object in Manager.py | DreHit17/C4DToolbox | 3c23a83ee31e09c4faf0c05933fd491017f30aef | [
"MIT"
] | 2 | 2019-01-25T12:33:13.000Z | 2021-05-21T01:42:48.000Z | import c4d # reference Cinema4D's existing library of code, called a "module"
def main(): # Define the main function of the script
ActiveObject = doc.GetActiveObject() # Define ActiveObject to look for the currently selected object in the manager
if ActiveObject == None: return # If there is no object sel... | 68.947368 | 127 | 0.755725 |
96b58db3b2c0505d8c3d4806b289fe3bebe4e941 | 10,680 | py | Python | aiobittrex/socket.py | ape364/aiobittrex | f35126664ced09f73905b89b20b0f24e508a2c47 | [
"MIT"
] | null | null | null | aiobittrex/socket.py | ape364/aiobittrex | f35126664ced09f73905b89b20b0f24e508a2c47 | [
"MIT"
] | null | null | null | aiobittrex/socket.py | ape364/aiobittrex | f35126664ced09f73905b89b20b0f24e508a2c47 | [
"MIT"
] | null | null | null | import asyncio
import hashlib
import hmac
import json
import logging
import time
from base64 import b64decode
from urllib.parse import urlencode
from zlib import decompress, MAX_WBITS
import aiohttp
from aiobittrex import BittrexSocketError, BittrexSocketConnectionClosed, BittrexSocketConnectionError
logger = loggin... | 31.22807 | 114 | 0.469757 |
404184341d793729c1f30de373a63520bf34025c | 430 | py | Python | test/test_login.py | IrinaSlobodchikova/marker | 72f981134fb025a94348cd2bc829fa8430a01372 | [
"Apache-2.0"
] | null | null | null | test/test_login.py | IrinaSlobodchikova/marker | 72f981134fb025a94348cd2bc829fa8430a01372 | [
"Apache-2.0"
] | null | null | null | test/test_login.py | IrinaSlobodchikova/marker | 72f981134fb025a94348cd2bc829fa8430a01372 | [
"Apache-2.0"
] | null | null | null |
#def test_marker_login(app):
# username = app.username
# password = app.password
# app.session.ensure_login_marker(username, password)
# user = app.session.get_logged_user_marker()
# assert username == user
def test_marker_login(app):
username = app.username
password = app.password
app.ses... | 26.875 | 56 | 0.718605 |
90bedf995290b70cdc1c1e8156090b8562036407 | 1,031 | py | Python | xhr/resources/conditional.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | 4 | 2020-09-09T15:28:01.000Z | 2021-12-01T00:59:56.000Z | xhr/resources/conditional.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | 1 | 2021-03-31T20:23:55.000Z | 2021-03-31T20:23:55.000Z | xhr/resources/conditional.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | 1 | 2020-03-31T17:20:54.000Z | 2020-03-31T17:20:54.000Z | def main(request, response):
tag = request.GET.first("tag", None)
match = request.headers.get("If-None-Match", None)
date = request.GET.first("date", "")
modified = request.headers.get("If-Modified-Since", None)
cors = request.GET.first("cors", None)
if request.method == "OPTIONS":
resp... | 34.366667 | 77 | 0.604268 |
09bc6334718f8576d8c8fe62b7e0168b5f33bbe2 | 10,445 | py | Python | references/detection/train.py | futurelife2016/vision | bbd9ff8fb936846aa0412996abab19b563677e5b | [
"BSD-3-Clause"
] | 1 | 2022-01-06T01:58:01.000Z | 2022-01-06T01:58:01.000Z | references/detection/train.py | futurelife2016/vision | bbd9ff8fb936846aa0412996abab19b563677e5b | [
"BSD-3-Clause"
] | null | null | null | references/detection/train.py | futurelife2016/vision | bbd9ff8fb936846aa0412996abab19b563677e5b | [
"BSD-3-Clause"
] | null | null | null | r"""PyTorch Detection Training.
To run in a multi-gpu environment, use the distributed launcher::
python -m torch.distributed.launch --nproc_per_node=$NGPU --use_env \
train.py ... --world-size $NGPU
The default hyperparameters are tuned for training on 8 gpus and 2 images per gpu.
--lr 0.02 --batch-... | 39.866412 | 118 | 0.688368 |
3519c9b5687d86196b96625d707333e1ce2cf060 | 3,207 | py | Python | docs/gallery/legend3.py | ecmwf/metview-docs | cfde15232834c2d2a8393e7e6ba67ba95acd51e0 | [
"Apache-2.0"
] | 2 | 2021-07-19T09:02:33.000Z | 2021-09-01T14:29:50.000Z | docs/gallery/legend3.py | ecmwf/metview-docs | cfde15232834c2d2a8393e7e6ba67ba95acd51e0 | [
"Apache-2.0"
] | 1 | 2021-10-14T11:53:08.000Z | 2021-12-01T10:07:34.000Z | docs/gallery/legend3.py | ecmwf/metview-docs | cfde15232834c2d2a8393e7e6ba67ba95acd51e0 | [
"Apache-2.0"
] | null | null | null | """
GRIB - Histogram Legend
"""
# (C) Copyright 2017- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue ... | 28.131579 | 88 | 0.688494 |
2bc392b583d6de2219c23b663efe981122f68738 | 1,880 | py | Python | helpers/file_saver.py | jameslafa/500px-fav-downloader | 08a6bd46fc45aefed4630d0bffea8d410162f273 | [
"MIT"
] | 1 | 2016-02-08T22:13:37.000Z | 2016-02-08T22:13:37.000Z | helpers/file_saver.py | jameslafa/500px-fav-downloader | 08a6bd46fc45aefed4630d0bffea8d410162f273 | [
"MIT"
] | null | null | null | helpers/file_saver.py | jameslafa/500px-fav-downloader | 08a6bd46fc45aefed4630d0bffea8d410162f273 | [
"MIT"
] | null | null | null | import os
import requests
class FileSaver:
"""
Save a file to different storages
"""
# For the moment we only support disk, dropbox will come soon
SUPPORTED_STORAGE_TYPES = ['disk']
def __init__(self, storage_type, disk_storage_path=None):
"""
Build a FileSaver instance
... | 32.413793 | 88 | 0.604255 |
9f436b2e5272a9d4785046874eae26fcb7f688dc | 1,239 | py | Python | LeetCodeSolutions/python/127_Word_Ladder.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | 1 | 2017-03-27T13:38:37.000Z | 2017-03-27T13:38:37.000Z | LeetCodeSolutions/python/127_Word_Ladder.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | null | null | null | LeetCodeSolutions/python/127_Word_Ladder.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | null | null | null | import string
from collections import Set
class Solution(object):
def ladderLength(self, beginWord, endWord, wordList):
"""
:type beginWord: str
:type endWord: str
:type wordList: Set[str]
:rtype: int
"""
word_list = set(wordList)
if beginWord in wor... | 26.361702 | 58 | 0.436642 |
918edb56a95aa7badf30c97e83c11dfff6a26eeb | 49 | py | Python | tests/General/Varnametest.py | soodsidd/instpyr | 138d0a8164dc388187fde58329b9ff770af77af4 | [
"MIT"
] | null | null | null | tests/General/Varnametest.py | soodsidd/instpyr | 138d0a8164dc388187fde58329b9ff770af77af4 | [
"MIT"
] | null | null | null | tests/General/Varnametest.py | soodsidd/instpyr | 138d0a8164dc388187fde58329b9ff770af77af4 | [
"MIT"
] | null | null | null |
a=1
print(nameof(a))
print(eval('a+5'))
print(a) | 9.8 | 18 | 0.632653 |
f19ce2de858d7815208f1d4ae67ad65602e0d979 | 436 | py | Python | microcosm_sagemaker/tests/app_hooks/evaluate/config.py | globality-corp/microcosm-sagemaker | c112ea2c1f5c40c1973c292b73ca0fadbf461280 | [
"Apache-2.0"
] | null | null | null | microcosm_sagemaker/tests/app_hooks/evaluate/config.py | globality-corp/microcosm-sagemaker | c112ea2c1f5c40c1973c292b73ca0fadbf461280 | [
"Apache-2.0"
] | 15 | 2019-04-22T19:46:32.000Z | 2022-02-11T17:31:43.000Z | microcosm_sagemaker/tests/app_hooks/evaluate/config.py | globality-corp/microcosm-sagemaker | c112ea2c1f5c40c1973c292b73ca0fadbf461280 | [
"Apache-2.0"
] | null | null | null | """
Configure the application.
"""
from microcosm.config.model import Configuration
from microcosm.metadata import Metadata
def load_default_config(metadata: Metadata) -> Configuration:
"""
Construct application default configuration.
There should be very little here.
"""
config = Configuratio... | 18.956522 | 61 | 0.715596 |
a7a9868baccb301c588101e1d710e18a8985aeae | 37,245 | py | Python | python/pyspark/ml/tests.py | ruby-/spark-parent_2.11 | 5f5e9583f705bcdbf73321e14e02b539dc3f08b1 | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | python/pyspark/ml/tests.py | ruby-/spark-parent_2.11 | 5f5e9583f705bcdbf73321e14e02b539dc3f08b1 | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | python/pyspark/ml/tests.py | ruby-/spark-parent_2.11 | 5f5e9583f705bcdbf73321e14e02b539dc3f08b1 | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 40.928571 | 99 | 0.623976 |
cc4a626327e7e73a246d2263da658c946326c65d | 323 | py | Python | src/test/testKnot/sub.py | qftphys/Calculation-of-thermal-conductivity-of-graphene-knot-under-strain- | 90537448eef11b034cb252025295868591de0919 | [
"MIT"
] | 2 | 2017-06-19T05:58:58.000Z | 2017-09-28T08:31:29.000Z | src/test/testKnot/sub.py | qftphys/Calculation-of-thermal-conductivity-of-graphene-knot-under-strain- | 90537448eef11b034cb252025295868591de0919 | [
"MIT"
] | null | null | null | src/test/testKnot/sub.py | qftphys/Calculation-of-thermal-conductivity-of-graphene-knot-under-strain- | 90537448eef11b034cb252025295868591de0919 | [
"MIT"
] | null | null | null | from aces import Aces
class sub(Aces):
def submit(self):
opt=dict(
units="metal",
species="graphene_knot",
method="nvt",
nodes=1,
procs=12,
queue="q1.1",
runTime=10000000
,runner="mdTc"
)
app=dict(latx=70,laty=2)
self.commit(opt,app);
if __name__=='__main__':
sub().run(... | 17.944444 | 28 | 0.597523 |
91aef4be0b1227e5097cc786d0d3c5b3108eb06c | 582 | py | Python | libra_client/error.py | yuan-xy/libra-client | 697058bfa7bc8e8a7a2598dae4bb289f44524dba | [
"MIT"
] | 30 | 2019-09-16T12:50:33.000Z | 2020-10-27T20:06:26.000Z | libra_client/error.py | yuan-xy/libra-client | 697058bfa7bc8e8a7a2598dae4bb289f44524dba | [
"MIT"
] | 7 | 2019-09-18T14:23:09.000Z | 2020-03-31T10:10:04.000Z | libra_client/error.py | yuan-xy/libra-client | 697058bfa7bc8e8a7a2598dae4bb289f44524dba | [
"MIT"
] | 12 | 2019-09-22T15:43:56.000Z | 2020-08-07T08:51:35.000Z |
class LibraError(Exception):
pass
class AccountError(LibraError):
pass
class TransactionError(LibraError):
@property
def error_code(self):
code, _ = self.args
return code
@property
def error_msg(self):
_, msg = self.args
return msg
cla... | 14.55 | 47 | 0.639175 |
e90345405ce81e36894a862e7308698923a12cdf | 591 | py | Python | wordservice/src/wordservice/word_service.py | mjm461/step-funtions-example | 3cd77cdc03b42d7496e47e505c19161b4913b110 | [
"MIT"
] | null | null | null | wordservice/src/wordservice/word_service.py | mjm461/step-funtions-example | 3cd77cdc03b42d7496e47e505c19161b4913b110 | [
"MIT"
] | null | null | null | wordservice/src/wordservice/word_service.py | mjm461/step-funtions-example | 3cd77cdc03b42d7496e47e505c19161b4913b110 | [
"MIT"
] | null | null | null | import os
from .trie import Trie
class WordService(object):
_resources_dir = os.path.normpath(os.path.join(os.path.dirname(__file__), 'resources'))
def __init__(self):
self._trie = Trie()
with open(os.path.join(self._resources_dir, 'words_alpha.txt')) as fin:
for word in fin.read... | 28.142857 | 91 | 0.632826 |
4025398e90983cf52a5e14807954e78264750801 | 1,925 | py | Python | python/GafferTractorUI/__init__.py | sebaDesmet/gaffer | 47b2d093c40452bd77947e3b5bd0722a366c8d59 | [
"BSD-3-Clause"
] | 1 | 2019-08-02T16:49:59.000Z | 2019-08-02T16:49:59.000Z | python/GafferTractorUI/__init__.py | rkoschmitzky/gaffer | ec6262ae1292767bdeb9520d1447d65a4a511884 | [
"BSD-3-Clause"
] | null | null | null | python/GafferTractorUI/__init__.py | rkoschmitzky/gaffer | ec6262ae1292767bdeb9520d1447d65a4a511884 | [
"BSD-3-Clause"
] | 1 | 2020-12-21T12:33:49.000Z | 2020-12-21T12:33:49.000Z | ##########################################################################
#
# Copyright (c) 2016, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | 48.125 | 93 | 0.688831 |
2185d391562abc2f45a9a0c1ad300920121c042e | 11,563 | py | Python | eth_enr/sqlite3_db.py | ethereum/eth-enr | 80bd08a3be09a6a1f6cc3145e44851e1e1bf71d9 | [
"MIT"
] | 4 | 2020-09-01T07:46:51.000Z | 2021-11-04T14:09:02.000Z | eth_enr/sqlite3_db.py | ethereum/eth-enr | 80bd08a3be09a6a1f6cc3145e44851e1e1bf71d9 | [
"MIT"
] | 9 | 2020-09-02T01:56:09.000Z | 2020-11-30T16:00:01.000Z | eth_enr/sqlite3_db.py | ethereum/eth-enr | 80bd08a3be09a6a1f6cc3145e44851e1e1bf71d9 | [
"MIT"
] | 6 | 2020-08-31T22:31:47.000Z | 2022-03-28T18:50:04.000Z | import datetime
import logging
import operator
import sqlite3
from typing import Collection, Iterable, NamedTuple, Optional, Sequence, Tuple, Union
from eth_typing import NodeID
import rlp
from rlp.exceptions import DecodingError, DeserializationError, SerializationError
from eth_enr.abc import ENRAPI
from eth_enr.en... | 29.724936 | 144 | 0.644469 |
6d3ed99e9ef9084eb5840963c001badf6b15792a | 836 | py | Python | Bugscan_exploits-master/exp_list/exp-955.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-955.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-955.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#__author__ = '1c3z'
#ref http://www.wooyun.org/bugs/wooyun-2015-0105520
def assign(service, arg):
if service == "weaver_oa":
return True, arg
def audit(url):
payload = '''{"auths":[{"value":"-1%27%20UNION%20SELECT%201,2,md5(1),4,5,6,7,8,9,10,11,12,1... | 33.44 | 221 | 0.61244 |
0d0ca704097c712a9838afef51e6daa1b956643f | 3,741 | py | Python | aioworkers/worker/supervisor.py | aioworkers/aioworkers | 51f15924698df4fe13d777d66ed70c7f34f09c3a | [
"Apache-2.0"
] | 45 | 2017-04-26T23:50:30.000Z | 2021-12-29T03:21:06.000Z | aioworkers/worker/supervisor.py | aioworkers/aioworkers | 51f15924698df4fe13d777d66ed70c7f34f09c3a | [
"Apache-2.0"
] | 63 | 2017-08-01T10:35:45.000Z | 2022-03-01T18:07:49.000Z | aioworkers/worker/supervisor.py | aioworkers/aioworkers | 51f15924698df4fe13d777d66ed70c7f34f09c3a | [
"Apache-2.0"
] | 6 | 2017-10-19T08:21:23.000Z | 2021-12-29T03:25:32.000Z | import asyncio
import logging
import random
from .base import Worker
logger = logging.getLogger(__name__)
class Supervisor(Worker):
"""
config:
children: Union[int, list[str], list[dict]] - count or list
child: Mapping - config for child worker
"""
def __init__(self, *args, **kwargs)... | 33.401786 | 77 | 0.566961 |
10b8b97ceeac8d2461a7770c1d389e0c2f52898b | 1,449 | py | Python | test/test_modify_contact.py | MaximM27/Pythonfortesting_trainig | 07c283c4ac88fd2bb0ee81983abe8177a9b2eada | [
"Apache-2.0"
] | null | null | null | test/test_modify_contact.py | MaximM27/Pythonfortesting_trainig | 07c283c4ac88fd2bb0ee81983abe8177a9b2eada | [
"Apache-2.0"
] | null | null | null | test/test_modify_contact.py | MaximM27/Pythonfortesting_trainig | 07c283c4ac88fd2bb0ee81983abe8177a9b2eada | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
import random
def test_modify_contact_firstname(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.add_contact(Contact(firstname="test"))
old_contacts = db.get_contact_list()
cont = random.choice(old_contacts)
cont_index = old_contacts.index(c... | 43.909091 | 123 | 0.752243 |
c507b9f6bd9fdff35c4afd95a0a02d8ea48a0938 | 6,292 | py | Python | tests/test_ddl.py | athre0z/clickhouse-sqlalchemy | d4be4a818c2fadef8eeb76a59d11ff82fc2c433a | [
"MIT"
] | 1 | 2021-07-07T09:06:00.000Z | 2021-07-07T09:06:00.000Z | tests/test_ddl.py | athre0z/clickhouse-sqlalchemy | d4be4a818c2fadef8eeb76a59d11ff82fc2c433a | [
"MIT"
] | null | null | null | tests/test_ddl.py | athre0z/clickhouse-sqlalchemy | d4be4a818c2fadef8eeb76a59d11ff82fc2c433a | [
"MIT"
] | null | null | null | from sqlalchemy import Column
from sqlalchemy.sql.ddl import CreateTable
from clickhouse_sqlalchemy import types, engines, Table
from clickhouse_sqlalchemy.sql.ddl import DropTable
from tests.testcase import BaseTestCase
from tests.session import mocked_engine
class DDLTestCase(BaseTestCase):
def test_create_tab... | 30.692683 | 73 | 0.523999 |
3399e10fe8944dc9c416730e70108fdf8b6f2e39 | 3,542 | py | Python | openpathsampling/storage/stores/trajectory.py | bolhuis/openpathsampling | 4a12af0ee1143cdbc272b10a8c7cbea735566ce1 | [
"MIT"
] | 64 | 2016-07-06T13:38:51.000Z | 2022-03-30T15:58:01.000Z | openpathsampling/storage/stores/trajectory.py | bolhuis/openpathsampling | 4a12af0ee1143cdbc272b10a8c7cbea735566ce1 | [
"MIT"
] | 601 | 2016-06-13T10:22:01.000Z | 2022-03-25T00:10:40.000Z | openpathsampling/storage/stores/trajectory.py | hejung/openpathsampling | e8b091c92916561954542d40d17d7241b203d1ad | [
"MIT"
] | 45 | 2016-11-10T11:17:53.000Z | 2022-02-13T11:50:26.000Z | from openpathsampling.engines.trajectory import Trajectory
from openpathsampling.netcdfplus import ObjectStore, LoaderProxy
class TrajectoryStore(ObjectStore):
def __init__(self):
super(TrajectoryStore, self).__init__(Trajectory)
def to_dict(self):
return {}
def _save(self, trajectory, i... | 27.671875 | 80 | 0.573687 |
4420ba3336da945314618164cc4c689e8e05d28e | 4,226 | py | Python | axelrod/tests/unit/test_apavlov.py | mattshirtliffe/Axelrod | 367a787e16541fda6e6076200805f5bb6a863973 | [
"MIT"
] | null | null | null | axelrod/tests/unit/test_apavlov.py | mattshirtliffe/Axelrod | 367a787e16541fda6e6076200805f5bb6a863973 | [
"MIT"
] | null | null | null | axelrod/tests/unit/test_apavlov.py | mattshirtliffe/Axelrod | 367a787e16541fda6e6076200805f5bb6a863973 | [
"MIT"
] | 1 | 2018-10-07T19:07:18.000Z | 2018-10-07T19:07:18.000Z | """Test APavlov."""
import axelrod
from .test_player import TestPlayer
C, D = axelrod.Actions.C, axelrod.Actions.D
class TestAPavlov2006(TestPlayer):
name = "Adapative Pavlov 2006"
player = axelrod.APavlov2006
expected_classifier = {
'memory_depth': float('inf'),
'stochastic': False,
... | 40.634615 | 78 | 0.50071 |
5621619cc777a3b4db6a913a48826947eb818eda | 20,261 | py | Python | lib/test/test_api_callable.py | boswald1/django-homepage | c6f956d26b6f986be98c25022e763075ebf12bb1 | [
"BSD-3-Clause"
] | 1 | 2018-12-12T04:48:15.000Z | 2018-12-12T04:48:15.000Z | test-docker/venv/lib/python2.7/site-packages/test/test_api_callable.py | hmit208/appengine-transcoder | d3f7a292dccae6478955ab1121989868594f4ed8 | [
"Apache-2.0"
] | null | null | null | test-docker/venv/lib/python2.7/site-packages/test/test_api_callable.py | hmit208/appengine-transcoder | d3f7a292dccae6478955ab1121989868594f4ed8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 41.603696 | 85 | 0.62529 |
aa4ad0686bd5cf027b648b832c303dbf869916af | 10,653 | py | Python | app/scraper.py | PyDataBlog/arxiv-classifier | a903fc00aeb458e23937f69b5a429ea6fed4464e | [
"MIT"
] | null | null | null | app/scraper.py | PyDataBlog/arxiv-classifier | a903fc00aeb458e23937f69b5a429ea6fed4464e | [
"MIT"
] | null | null | null | app/scraper.py | PyDataBlog/arxiv-classifier | a903fc00aeb458e23937f69b5a429ea6fed4464e | [
"MIT"
] | null | null | null | import os
import time
import pandas as pd
import numpy as np
import sqlite3
import platform
from tqdm import tqdm
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWa... | 35.989865 | 124 | 0.589411 |
7aa90c136e1c862df32efb4d3d4f83d0c2e2124e | 4,871 | py | Python | datastore/google/cloud/datastore_v1/gapic/enums.py | di/google-cloud-python | a0bd8d0565e2a682760a113c59ce12b872bce9ab | [
"Apache-2.0"
] | 1 | 2019-05-23T11:25:32.000Z | 2019-05-23T11:25:32.000Z | datastore/google/cloud/datastore_v1/gapic/enums.py | di/google-cloud-python | a0bd8d0565e2a682760a113c59ce12b872bce9ab | [
"Apache-2.0"
] | null | null | null | datastore/google/cloud/datastore_v1/gapic/enums.py | di/google-cloud-python | a0bd8d0565e2a682760a113c59ce12b872bce9ab | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 33.826389 | 111 | 0.642579 |
ef9dfd3fb01c6e03c8af8192f16a18700c47c8ec | 1,489 | py | Python | fabtools/require/nodejs.py | return1/fabtools | a0c07852054efd7c795f0057689b249333498ef8 | [
"BSD-2-Clause"
] | 1 | 2020-11-05T21:53:21.000Z | 2020-11-05T21:53:21.000Z | fabtools/require/nodejs.py | return1/fabtools | a0c07852054efd7c795f0057689b249333498ef8 | [
"BSD-2-Clause"
] | null | null | null | fabtools/require/nodejs.py | return1/fabtools | a0c07852054efd7c795f0057689b249333498ef8 | [
"BSD-2-Clause"
] | null | null | null | """
Node.js
=======
This module provides tools for installing `Node.js`_ and managing
packages using `npm`_.
.. note: the ``simplejson`` module is required on Python 2.5
.. _Node.js: http://nodejs.org/
.. _npm: http://npmjs.org/
"""
from fabtools import nodejs
def installed_from_source(version=nodejs.DEFAULT_VERS... | 24.016129 | 71 | 0.667562 |
0de587209814d3560982f2aba89416b22c88fd9f | 12,041 | py | Python | airflow/providers/sftp/hooks/sftp.py | cmarteepants/airflow | 577c3d169cc7ee20c72a0d51a81989b562ab09af | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/providers/sftp/hooks/sftp.py | cmarteepants/airflow | 577c3d169cc7ee20c72a0d51a81989b562ab09af | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/providers/sftp/hooks/sftp.py | cmarteepants/airflow | 577c3d169cc7ee20c72a0d51a81989b562ab09af | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 36.377644 | 108 | 0.59912 |
b15826373d727f9098e172af154d12253dad56b6 | 527 | py | Python | graphics.py | rifatkhan512/turtle | 1ed9b2aaaddb2c4839d48c1e203d00dfd03458ba | [
"MIT"
] | null | null | null | graphics.py | rifatkhan512/turtle | 1ed9b2aaaddb2c4839d48c1e203d00dfd03458ba | [
"MIT"
] | null | null | null | graphics.py | rifatkhan512/turtle | 1ed9b2aaaddb2c4839d48c1e203d00dfd03458ba | [
"MIT"
] | null | null | null | import turtle as tt
import random
wn=tt.Screen()
wn.bgcolor("#333333")
size=0
tt.speed(0)
for i in range (185):
rn="#"
for i in range(6):
x=random.randint(0,2)
if x:
x=random.randint(0,9)
rn+=str(x)
else:
x=rand... | 19.518519 | 37 | 0.428843 |
e04e90e53d00381e68cf5036fc35a6b509c911ff | 2,115 | py | Python | python_code/dataset.py | FabioBCI/BCI_WEB | 94a67e480bf573d6277c8104b4b48aa5171b84f6 | [
"MIT"
] | null | null | null | python_code/dataset.py | FabioBCI/BCI_WEB | 94a67e480bf573d6277c8104b4b48aa5171b84f6 | [
"MIT"
] | null | null | null | python_code/dataset.py | FabioBCI/BCI_WEB | 94a67e480bf573d6277c8104b4b48aa5171b84f6 | [
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
import numpy as np
import scipy.io
class dataset():
def __init__(self):
self.X = [] #Datos
self.Y = [] #Labels
self.fm = 0
def generateSignal(self, amplitud, tamano):
y = 0
result = []
x = np.linspace(0, tama... | 28.2 | 95 | 0.496454 |
a1cf9c41e0e4f8c46ee67fbbdac8c3d130f8cb25 | 1,383 | py | Python | tests/parsers/products/test_GetMatchingProductForIdResult.py | Tberdy/python-amazon-mws-tools | 2925118ce113851a2d8db98ad7f99163154f4151 | [
"Unlicense"
] | 9 | 2017-03-28T12:58:36.000Z | 2020-03-02T14:42:32.000Z | tests/parsers/products/test_GetMatchingProductForIdResult.py | Tberdy/python-amazon-mws-tools | 2925118ce113851a2d8db98ad7f99163154f4151 | [
"Unlicense"
] | 5 | 2017-01-05T19:36:18.000Z | 2021-12-13T19:43:42.000Z | tests/parsers/products/test_GetMatchingProductForIdResult.py | Tberdy/python-amazon-mws-tools | 2925118ce113851a2d8db98ad7f99163154f4151 | [
"Unlicense"
] | 5 | 2017-02-15T17:29:02.000Z | 2019-03-06T07:30:55.000Z | from unittest import TestCase
from unittest import TestSuite
from unittest import main
from unittest import makeSuite
from mwstools.parsers.products import GetMatchingProductForIdResult
class TestGetMatchingProductForIdResult(TestCase):
body = """
<GetMatchingProductForIdResult Id="082676082658" IdType="UPC... | 24.696429 | 99 | 0.67462 |
11c473179412bda0914c3544cded68fcfdc0cc7d | 1,929 | py | Python | train.py | pasquini-dario/InterpretablePPSM | eb2732bb2e6f7e53827a2b0a2f46c9a4d84c42d8 | [
"Apache-2.0"
] | 2 | 2020-04-21T09:16:11.000Z | 2021-02-19T06:47:42.000Z | train.py | pasquini-dario/InterpretablePPSM | eb2732bb2e6f7e53827a2b0a2f46c9a4d84c42d8 | [
"Apache-2.0"
] | 2 | 2021-10-06T13:23:10.000Z | 2021-10-09T04:38:31.000Z | train.py | pasquini-dario/InterpretablePPSM | eb2732bb2e6f7e53827a2b0a2f46c9a4d84c42d8 | [
"Apache-2.0"
] | 2 | 2020-11-13T12:40:43.000Z | 2021-10-07T12:12:46.000Z | MODEL_OUT = 'HOME/MODELs'
LOG_OUT = 'HOME/LOGs'
import tensorflow as tf
gpus = tf.config.experimental.list_physical_devices('GPU')
import os, sys, gin
import modelCNN as model
import input_pipeline
from trainer import Trainer
import architectureCNN as architecture
def basenameNoExt(path, sep='.'):
name = os... | 25.72 | 136 | 0.62675 |
52594270776daa8f95eea39fc4298db6eeb68c12 | 15,925 | py | Python | semesterpage/migrations/0001_initial.py | JakobGM/WikiLinks | 5743b1d4c3fefa66fcaa4d283436d2a3f0490604 | [
"MIT"
] | 6 | 2017-08-12T09:55:06.000Z | 2019-09-03T08:05:21.000Z | semesterpage/migrations/0001_initial.py | JakobGM/WikiLinks | 5743b1d4c3fefa66fcaa4d283436d2a3f0490604 | [
"MIT"
] | 57 | 2017-08-11T23:05:07.000Z | 2022-03-11T23:32:12.000Z | semesterpage/migrations/0001_initial.py | JakobGM/WikiLinks | 5743b1d4c3fefa66fcaa4d283436d2a3f0490604 | [
"MIT"
] | 1 | 2017-09-27T15:31:15.000Z | 2017-09-27T15:31:15.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-05 00:21
from __future__ import unicode_literals
import autoslug.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import sanitizer.models
import semesterpage.models
class Migration(migratio... | 72.716895 | 763 | 0.643893 |
2a5626f84b3255e38bba4b98d88371caac376d1e | 885 | py | Python | setup.py | amercader/munibot | 8ee6d0449e41aa3cb1231f7855d95730ab567f8f | [
"MIT"
] | 4 | 2020-12-27T16:43:27.000Z | 2021-10-02T11:35:08.000Z | setup.py | amercader/munibot | 8ee6d0449e41aa3cb1231f7855d95730ab567f8f | [
"MIT"
] | 3 | 2020-12-13T14:22:08.000Z | 2021-04-04T21:55:11.000Z | setup.py | amercader/munibot | 8ee6d0449e41aa3cb1231f7855d95730ab567f8f | [
"MIT"
] | 2 | 2021-01-11T22:15:38.000Z | 2021-01-12T09:08:27.000Z | import setuptools
with open("README.md", "r") as f:
long_description = f.read()
with open("requirements.txt", "r") as f:
install_requires = f.readlines()
setuptools.setup(
name="munibot",
version="0.0.4",
author="Adrià Mercader",
author_email="amercadero@gmail.com",
description="A Twitter... | 29.5 | 86 | 0.672316 |
1ae5d5f3d14f715282d13916d4d43c40937a59e1 | 35,469 | py | Python | ITrackerData.py | MSREnable/GazeCapture | 54f00ab428a7dbb51f8f0c37f22bba6b3cb54726 | [
"RSA-MD"
] | 15 | 2019-08-28T22:06:51.000Z | 2021-10-08T09:52:13.000Z | ITrackerData.py | MSREnable/GazeCapture | 54f00ab428a7dbb51f8f0c37f22bba6b3cb54726 | [
"RSA-MD"
] | null | null | null | ITrackerData.py | MSREnable/GazeCapture | 54f00ab428a7dbb51f8f0c37f22bba6b3cb54726 | [
"RSA-MD"
] | 6 | 2020-11-18T02:46:55.000Z | 2021-07-08T11:12:11.000Z | import torch
import os
import os.path
import scipy.io as sio
import numpy as np
import math
from random import random, shuffle
# CPU data loader
from PIL import Image
import torchvision.transforms as transforms
from utility_functions.Utilities import centered_text
from torch.utils.data.dataloader import default_collat... | 42.733735 | 149 | 0.570526 |
3680907130497cccd71d6433c1c77714c52df836 | 1,187 | py | Python | redirect_server.py | ryotosaito/box-sync-for-python | 2aa65b90b37a443979da834bf83fef45be540d6d | [
"MIT"
] | null | null | null | redirect_server.py | ryotosaito/box-sync-for-python | 2aa65b90b37a443979da834bf83fef45be540d6d | [
"MIT"
] | null | null | null | redirect_server.py | ryotosaito/box-sync-for-python | 2aa65b90b37a443979da834bf83fef45be540d6d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from http.server import HTTPServer
from http.server import BaseHTTPRequestHandler
from http import HTTPStatus
from urllib import parse
code = ''
domain = '127.0.0.1'
port = 5050
url = 'http://' + domain + ':' + str(port) + '/'
class MyHandler(BaseHTTPRequestHandler):
def do_GET(self):
... | 25.804348 | 63 | 0.624263 |
654774d5ff03784fe1fa82c06690411cb64a8fb7 | 2,847 | py | Python | model-optimizer/unit_tests/extensions/front/tf/ComplexAbsAfterComplex_test.py | monroid/openvino | 8272b3857ef5be0aaa8abbf7bd0d5d5615dc40b6 | [
"Apache-2.0"
] | 2,406 | 2020-04-22T15:47:54.000Z | 2022-03-31T10:27:37.000Z | model-optimizer/unit_tests/extensions/front/tf/ComplexAbsAfterComplex_test.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 4,948 | 2020-04-22T15:12:39.000Z | 2022-03-31T18:45:42.000Z | model-optimizer/unit_tests/extensions/front/tf/ComplexAbsAfterComplex_test.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 991 | 2020-04-23T18:21:09.000Z | 2022-03-31T18:40:57.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from extensions.front.tf.ComplexAbsAfterComplex import ComplexAbsAfterComplex
from mo.front.common.partial_infer.utils import int64_array
from mo.utils.ir_engine.compare_graphs import compare_graphs
... | 37.96 | 116 | 0.572181 |
6646ad1ed108db9b95d08f633cb32d82734f9546 | 6,511 | py | Python | datadog_checks_base/tests/test_utils.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | 1 | 2021-03-24T13:00:14.000Z | 2021-03-24T13:00:14.000Z | datadog_checks_base/tests/test_utils.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_base/tests/test_utils.py | remicalixte/integrations-core | b115e18c52820fe1a92495f538fdc14ddf83cfe1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from decimal import ROUND_HALF_DOWN
import mock
import pytest
from six import PY3
from datadog_checks.base.utils.common import ensure_bytes, ensure_unicode, pattern_filter, roun... | 32.232673 | 120 | 0.603748 |
1fe5af9bf8bd63e082c87ac0e69e4b9cd27a9b1e | 2,027 | py | Python | kivyx/selection.py | yunus-ceyhan/kivyx | f4348eb8c00ad62346b827d1ab6197f8f84cde8e | [
"MIT"
] | 1 | 2022-03-28T07:27:32.000Z | 2022-03-28T07:27:32.000Z | kivyx/selection.py | yunus-ceyhan/kivyx | f4348eb8c00ad62346b827d1ab6197f8f84cde8e | [
"MIT"
] | null | null | null | kivyx/selection.py | yunus-ceyhan/kivyx | f4348eb8c00ad62346b827d1ab6197f8f84cde8e | [
"MIT"
] | null | null | null |
"""
<MainApp>:
XSwitch:
pos_hint: {"center_x": .5, "center_y": .5}
active: True
style: "m3"
"""
from kivyx.behavior import CircularBehavior
from kivy.clock import Clock
from kivy.lang import Builder
from kivyx.boxlayout import XBoxLayout
from kivy.properties import ColorProperty, ... | 30.712121 | 112 | 0.614702 |
c32cba98ebd9e0cff698158bc310d0ef3b653be1 | 9,223 | py | Python | model_causal.py | ljuvela/GELP | 6d1084aa7471530224c8f0498efcce696069ec87 | [
"Apache-2.0"
] | 27 | 2019-07-02T19:21:32.000Z | 2021-04-03T21:09:31.000Z | model_causal.py | ljuvela/GELP | 6d1084aa7471530224c8f0498efcce696069ec87 | [
"Apache-2.0"
] | 1 | 2021-04-20T03:05:17.000Z | 2021-04-21T10:21:07.000Z | model_causal.py | ljuvela/GELP | 6d1084aa7471530224c8f0498efcce696069ec87 | [
"Apache-2.0"
] | 6 | 2020-08-10T01:39:41.000Z | 2021-07-28T13:45:53.000Z | from __future__ import division, print_function
__author__ = "Lauri Juvela, lauri.juvela@aalto.fi"
import os
import sys
import math
import numpy as np
import tensorflow as tf
_FLOATX = tf.float32 # todo: move to lib/precision.py
def get_weight_variable(name, shape=None, initial_value=None):
if shape is None:
... | 34.543071 | 117 | 0.541364 |
0c1c909331ca19bc05feaf4cf513f360b5d269e9 | 2,818 | py | Python | model/analyze/01-single-analysis.py | pacslab/conc-value-perf-modelling | 156320c3e9669149b10ea54d5ac0a1de8d0a7013 | [
"MIT"
] | null | null | null | model/analyze/01-single-analysis.py | pacslab/conc-value-perf-modelling | 156320c3e9669149b10ea54d5ac0a1de8d0a7013 | [
"MIT"
] | null | null | null | model/analyze/01-single-analysis.py | pacslab/conc-value-perf-modelling | 156320c3e9669149b10ea54d5ac0a1de8d0a7013 | [
"MIT"
] | null | null | null | # %% Imports
import sys
import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
import pandas as pd
import itertools
from tqdm.auto import tqdm
# import concperf by adding its path
sys.path.append('..')
from concperf import single_model
from concperf import utility
# %% create config
config = {
"b... | 28.464646 | 89 | 0.678141 |
162942e762bda5d0c98cb313a3eb19a92d897ebd | 10,341 | py | Python | twotp/test/test_parser.py | lunay001/TwOTP | 8c5d6437f30678926b87c3b015b5aa4df70f2349 | [
"MIT"
] | null | null | null | twotp/test/test_parser.py | lunay001/TwOTP | 8c5d6437f30678926b87c3b015b5aa4df70f2349 | [
"MIT"
] | null | null | null | twotp/test/test_parser.py | lunay001/TwOTP | 8c5d6437f30678926b87c3b015b5aa4df70f2349 | [
"MIT"
] | null | null | null | # Copyright (c) 2007-2009 Thomas Herve <therve@free.fr>.
# See LICENSE for details.
"""
Parser tests.
"""
from twotp.term import Atom, Tuple, Pid, Reference, Integer, List
from twotp.term import Float, Port, Binary, Fun, NewFun, Export, BitBinary
from twotp.parser import Parser, RemainingDataError, UnhandledCode
from... | 30.325513 | 79 | 0.54163 |
be17390c79761367254aa42e4546bd6b40e5b260 | 2,010 | py | Python | messungen/noverplot.py | tihmstar/gido_public | dcc523603b9a27b37752211715a10e30b51ce812 | [
"Unlicense"
] | 16 | 2021-04-10T16:28:00.000Z | 2021-12-12T10:15:23.000Z | messungen/noverplot.py | tihmstar/gido_public | dcc523603b9a27b37752211715a10e30b51ce812 | [
"Unlicense"
] | null | null | null | messungen/noverplot.py | tihmstar/gido_public | dcc523603b9a27b37752211715a10e30b51ce812 | [
"Unlicense"
] | 2 | 2021-04-10T16:32:36.000Z | 2021-04-11T14:13:45.000Z | import struct
import sys
import matplotlib.pyplot as plt
import numpy as np
import mmap
import os
fontsize = 30
ticksize = 3
legendsize = 18
POINTS_END = None
if len(sys.argv) < 2:
print("Usage: %s <path ....>" %(sys.argv[0]))
for p in sys.argv[1:]:
file = p
filename = file.split("/")[-1]
try:
... | 23.647059 | 85 | 0.635323 |
c8ff8970d2282ace1d1293b887f16c5f6742fd0d | 4,862 | py | Python | model/shared_conv.py | chenzhuomit/6.860_final_project | 5218b5ba127b8f36bbcf901ee8b3e97a8a8eaa3b | [
"MIT"
] | null | null | null | model/shared_conv.py | chenzhuomit/6.860_final_project | 5218b5ba127b8f36bbcf901ee8b3e97a8a8eaa3b | [
"MIT"
] | null | null | null | model/shared_conv.py | chenzhuomit/6.860_final_project | 5218b5ba127b8f36bbcf901ee8b3e97a8a8eaa3b | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch.nn import functional as F
from .resnet import ResNet
class SharedResBlock(nn.Module):
def __init__(self, hidden_channels, kernel_size, batch_norm=True, resnet=True, dropout=0.):
super().__init__()
self.hidden_channels = hidden_channels
self.kern... | 43.026549 | 211 | 0.657754 |
3d56b1ce0b982af7e6b2409dbdd4215956836d27 | 8,698 | py | Python | nn/unet.py | bohaohuang/ersa | e13ceae16929362f5ef49db1ab0f3237855aa2ac | [
"MIT"
] | null | null | null | nn/unet.py | bohaohuang/ersa | e13ceae16929362f5ef49db1ab0f3237855aa2ac | [
"MIT"
] | null | null | null | nn/unet.py | bohaohuang/ersa | e13ceae16929362f5ef49db1ab0f3237855aa2ac | [
"MIT"
] | 1 | 2020-07-01T16:54:11.000Z | 2020-07-01T16:54:11.000Z | import os
import tensorflow as tf
from nn import basicNetwork
from nn import nn_utils
class UNet(basicNetwork.SegmentationNetwork):
"""
Implements the U-Net from https://arxiv.org/pdf/1505.04597.pdf
"""
def __init__(self, class_num, input_size, dropout_rate=None, name='unet', suffix='', learn_rate=1e-... | 51.164706 | 117 | 0.57381 |
cf82c65798c705b2bc67382367b8caae76726a4b | 53,961 | py | Python | mne/channels/channels.py | massich/mne-python | 9afcbcb21ca5df53eaf26911d0199dcc04bfc4ba | [
"BSD-3-Clause"
] | null | null | null | mne/channels/channels.py | massich/mne-python | 9afcbcb21ca5df53eaf26911d0199dcc04bfc4ba | [
"BSD-3-Clause"
] | 23 | 2017-09-12T11:08:26.000Z | 2019-10-04T11:11:29.000Z | mne/channels/channels.py | massich/mne-python | 9afcbcb21ca5df53eaf26911d0199dcc04bfc4ba | [
"BSD-3-Clause"
] | 3 | 2019-01-28T13:48:00.000Z | 2019-07-10T16:02:11.000Z | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Denis Engemann <denis.engemann@gmail.com>
# Andrew Dykstra <andrew.r.dykstra@gmail.com>
# Teon Brooks <teon.brooks@gmail.com>
#
# License: BSD (3-clause)
import os
import os.pa... | 37.603484 | 79 | 0.588592 |
8d00568c0692ef921dd0bbda0eefcab73493f0ce | 7,705 | py | Python | data_helpers.py | alexeyev/CNN-for-Sentence-Classification-in-Keras | 1a011950b9256f1c6da5b7f46dd6826fb2a3bafe | [
"MIT"
] | 7 | 2016-09-29T09:46:13.000Z | 2018-05-23T09:29:38.000Z | data_helpers.py | alexeyev/CNN-for-Sentence-Classification-in-Keras | 1a011950b9256f1c6da5b7f46dd6826fb2a3bafe | [
"MIT"
] | null | null | null | data_helpers.py | alexeyev/CNN-for-Sentence-Classification-in-Keras | 1a011950b9256f1c6da5b7f46dd6826fb2a3bafe | [
"MIT"
] | 1 | 2019-07-02T06:26:59.000Z | 2019-07-02T06:26:59.000Z | # coding:utf-8
"""
Custom datasets reading and preprocessing routines
"""
import itertools
import re
from collections import Counter
import numpy as np
import pandas as pd
import pymystem3
mystem = pymystem3.Mystem()
def clean_str(string):
"""
Tokenization/string cleaning for all datasets except fo... | 32.37395 | 115 | 0.670993 |
dd61b6b3ce3f8d32f8e1ae4c0fc133412ad32823 | 523 | py | Python | mmedit/models/backbones/encoder_decoders/encoders/__init__.py | rivergold/mmediting | fd972635c48bb065db29d1b5090592a87c7263d2 | [
"Apache-2.0"
] | 1 | 2021-04-30T23:08:16.000Z | 2021-04-30T23:08:16.000Z | mmedit/models/backbones/encoder_decoders/encoders/__init__.py | rivergold/mmediting | fd972635c48bb065db29d1b5090592a87c7263d2 | [
"Apache-2.0"
] | null | null | null | mmedit/models/backbones/encoder_decoders/encoders/__init__.py | rivergold/mmediting | fd972635c48bb065db29d1b5090592a87c7263d2 | [
"Apache-2.0"
] | 2 | 2021-09-07T05:21:18.000Z | 2021-09-17T22:34:54.000Z | from .deepfill_encoder import DeepFillEncoder
from .gl_encoder import GLEncoder
from .indexnet_encoder import (DepthwiseIndexBlock, HolisticIndexBlock,
IndexNetEncoder)
from .pconv_encoder import PConvEncoder
from .resnet_enc import ResGCAEncoder, ResNetEnc, ResShortcutEnc
from .vgg impor... | 37.357143 | 79 | 0.751434 |
3c32d1ba8369e99f2afe58d675224de3e510c4c2 | 3,062 | py | Python | salt/utils/decorators/state.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | salt/utils/decorators/state.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | salt/utils/decorators/state.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
Decorators for salt.state
:codeauthor: :email:`Bo Maryniuk (bo@suse.de)`
'''
# Import Python libs
from __future__ import absolute_import, unicode_literals
import logging
# Import salt libs
import salt.utils.stringutils
from salt.exceptions import SaltException
log = logging.getLogger(__n... | 32.574468 | 116 | 0.545395 |
eda9603db063d35edf9811595032bf20a9f8600d | 76 | py | Python | python/test/test_two-dimensional_array.py | 1005281342/learn | c9d1e2e256842d9b4846c4870ac72e83d172b20e | [
"Apache-2.0"
] | 1 | 2018-11-29T01:01:32.000Z | 2018-11-29T01:01:32.000Z | python/test/test_two-dimensional_array.py | 1005281342/learn | c9d1e2e256842d9b4846c4870ac72e83d172b20e | [
"Apache-2.0"
] | null | null | null | python/test/test_two-dimensional_array.py | 1005281342/learn | c9d1e2e256842d9b4846c4870ac72e83d172b20e | [
"Apache-2.0"
] | null | null | null | a = [1, 2, 3]
b = [3, 2, 1]
res = [i + j for i in a for j in b]
print(res)
| 12.666667 | 35 | 0.460526 |
8e3e3b0afb443f99f9960d7f468f0200c7044fe1 | 49 | py | Python | app/s2t2_script.py | antoniogriffith/example-open-source-repo-2021 | 7ae3e8342a0acf60b491e938566156215ccc4d14 | [
"MIT"
] | null | null | null | app/s2t2_script.py | antoniogriffith/example-open-source-repo-2021 | 7ae3e8342a0acf60b491e938566156215ccc4d14 | [
"MIT"
] | null | null | null | app/s2t2_script.py | antoniogriffith/example-open-source-repo-2021 | 7ae3e8342a0acf60b491e938566156215ccc4d14 | [
"MIT"
] | null | null | null |
print("HELLO WORLD!")
print("akg74_script.py")
| 9.8 | 24 | 0.693878 |
ae64668d45c2fef25a01df8a0211d105a9fdace1 | 959 | py | Python | transcriptic/sampledata/project.py | transcriptic/transcriptic | 1b5df943db266d18dbf055d0ace68c3cde8980e9 | [
"BSD-3-Clause"
] | 32 | 2015-10-27T22:51:05.000Z | 2020-03-26T00:43:32.000Z | transcriptic/sampledata/project.py | transcriptic/transcriptic | 1b5df943db266d18dbf055d0ace68c3cde8980e9 | [
"BSD-3-Clause"
] | 95 | 2015-10-27T15:30:46.000Z | 2020-03-30T00:38:05.000Z | transcriptic/sampledata/project.py | transcriptic/transcriptic | 1b5df943db266d18dbf055d0ace68c3cde8980e9 | [
"BSD-3-Clause"
] | 10 | 2015-10-27T06:35:30.000Z | 2019-09-26T15:18:49.000Z | from transcriptic.jupyter import Project
from transcriptic.util import load_sampledata_json
def load_project_from_attributes(project_id: str, attributes: dict) -> Project:
"""
Helper function for constructing an object from specified attributes
"""
return Project(
project_id,
attribute... | 22.833333 | 79 | 0.671533 |
f76a15d5a214460f77c5f990a1f21e5a8a02763b | 1,440 | py | Python | leetcode/editor/cn/FriendsOfAppropriateAges.py | huangge1199/leet-code-python | 5d01bbb6f12a495ea7ea0a90b5b3b4aa92bcc2f7 | [
"Apache-2.0"
] | 1 | 2022-02-12T13:55:41.000Z | 2022-02-12T13:55:41.000Z | leetcode/editor/cn/FriendsOfAppropriateAges.py | huangge1199/leet-code-python | 5d01bbb6f12a495ea7ea0a90b5b3b4aa92bcc2f7 | [
"Apache-2.0"
] | null | null | null | leetcode/editor/cn/FriendsOfAppropriateAges.py | huangge1199/leet-code-python | 5d01bbb6f12a495ea7ea0a90b5b3b4aa92bcc2f7 | [
"Apache-2.0"
] | null | null | null | # 在社交媒体网站上有 n 个用户。给你一个整数数组 ages ,其中 ages[i] 是第 i 个用户的年龄。
#
# 如果下述任意一个条件为真,那么用户 x 将不会向用户 y(x != y)发送好友请求:
#
#
# age[y] <= 0.5 * age[x] + 7
# age[y] > age[x]
# age[y] > 100 && age[x] < 100
#
#
# 否则,x 将会向 y 发送一条好友请求。
#
# 注意,如果 x 向 y 发送一条好友请求,y 不必也向 x 发送一条好友请求。另外,用户不会向自己发送好友请求。
#
# 返回在该社交媒体网站上产生的好友请求... | 17.777778 | 66 | 0.506944 |
9fe19eabdaf00e746f5c45764afcfdfdcac0c5c6 | 102 | py | Python | basedir.py | xdvlabs/xumm-sdk-py | c92066a6e9738e402e0ae1627dd21fbc6b3bead1 | [
"MIT"
] | 4 | 2022-01-29T11:22:06.000Z | 2022-03-01T03:36:59.000Z | basedir.py | CASL-AE/xumm-py | dbe040f409ffc5f918086a12f190ef289e709d22 | [
"MIT"
] | 4 | 2022-01-14T22:49:02.000Z | 2022-01-18T17:32:21.000Z | basedir.py | CASL-AE/xumm-py | dbe040f409ffc5f918086a12f190ef289e709d22 | [
"MIT"
] | 2 | 2022-03-01T03:32:35.000Z | 2022-03-20T17:11:56.000Z | #!/usr/bin/env python
# coding: utf-8
import os
basedir = os.path.abspath(os.path.dirname(__file__))
| 17 | 52 | 0.72549 |
989f76b647fa12a158a99018d1de348250889d14 | 934 | py | Python | ailib/tools/utils_ipython.py | vandykai/ailib | 6ccb9536dc3f6f8ff138335d0153a2982635fca8 | [
"Apache-2.0"
] | null | null | null | ailib/tools/utils_ipython.py | vandykai/ailib | 6ccb9536dc3f6f8ff138335d0153a2982635fca8 | [
"Apache-2.0"
] | null | null | null | ailib/tools/utils_ipython.py | vandykai/ailib | 6ccb9536dc3f6f8ff138335d0153a2982635fca8 | [
"Apache-2.0"
] | null | null | null | from contextlib import contextmanager
import pandas as pd
import IPython
@contextmanager
def pd_display_all():
max_columns = pd.options.display.max_columns
max_rows = pd.options.display.max_rows
pd.options.display.max_columns=None
pd.options.display.max_rows=None
yield None
pd.options.display.m... | 28.30303 | 48 | 0.759101 |
b5e2f6574ed00b2298d8ff29f4499bc2c3d75a43 | 384 | py | Python | tests/echo.py | beosro/judy | 37fa9513dd755a865248c1cf26f197259b99a1fb | [
"MIT"
] | 35 | 2016-09-02T08:27:51.000Z | 2021-08-02T22:22:08.000Z | tests/echo.py | nickoala/judy | 37fa9513dd755a865248c1cf26f197259b99a1fb | [
"MIT"
] | null | null | null | tests/echo.py | nickoala/judy | 37fa9513dd755a865248c1cf26f197259b99a1fb | [
"MIT"
] | 26 | 2017-01-11T04:54:08.000Z | 2019-07-10T04:35:42.000Z | import judy
vin = judy.VoiceIn(adcdev='plughw:1,0',
lm='/home/pi/judy/resources/lm/0931.lm',
dict='/home/pi/judy/resources/lm/0931.dic')
vout = judy.VoiceOut(device='plughw:0,0',
resources='/home/pi/judy/resources/audio')
def handle(phrase):
print 'Heard... | 25.6 | 63 | 0.596354 |
8b2ec94fdc3a66d27a633ff774c3f7bfd7ad835e | 13,087 | py | Python | tests/test_hint_headers.py | davidnarum/bebras-platform | 2ff4abb121e4eb0ef3a635c363169b70ccef2666 | [
"MIT"
] | 5 | 2017-06-08T10:14:16.000Z | 2021-07-27T21:51:58.000Z | tests/test_hint_headers.py | davidnarum/bebras-platform | 2ff4abb121e4eb0ef3a635c363169b70ccef2666 | [
"MIT"
] | 22 | 2016-09-01T20:21:13.000Z | 2021-06-22T15:19:33.000Z | tests/test_hint_headers.py | davidnarum/bebras-platform | 2ff4abb121e4eb0ef3a635c363169b70ccef2666 | [
"MIT"
] | 8 | 2015-12-01T12:55:49.000Z | 2020-11-01T13:33:58.000Z | #!/usr/bin/env python3
"""
This script exercises all endpoints normally accessed during a contest,
and checks that the X-Backend-Hints headers are correctly set on each
response.
"""
import http.client
import http.cookies
import json
import urllib.request
import urllib.parse
import urllib.error
import re
import sys
i... | 36.454039 | 95 | 0.560098 |
52a1eed7213f28307ab010f76a0469ac671483cd | 28,613 | py | Python | pythonlibs/mantis/BlueEarth/vendor/concox/gt03/message.py | adoggie/Tibet.6 | 3c53060edafd80b9c4dafa10699a68d86a410c66 | [
"MIT"
] | 22 | 2019-10-28T07:28:12.000Z | 2022-03-19T15:36:41.000Z | pythonlibs/mantis/BlueEarth/vendor/concox/gt03/message.py | adoggie/Tibet.6 | 3c53060edafd80b9c4dafa10699a68d86a410c66 | [
"MIT"
] | 1 | 2019-11-07T04:54:14.000Z | 2019-11-07T07:12:48.000Z | pythonlibs/mantis/BlueEarth/vendor/concox/gt03/message.py | adoggie/Tibet.6 | 3c53060edafd80b9c4dafa10699a68d86a410c66 | [
"MIT"
] | 13 | 2019-10-28T07:29:07.000Z | 2021-11-03T06:53:12.000Z | #coding:utf-8
import datetime
import struct
from protocal import PacketType,MessageClsDict,TypeValue
from utils import ByteBuf
from mantis.fundamental.utils.useful import hash_object,object_assign
from mantis.fundamental.utils.useful import singleton
TIME_EAST = 0
TIME_WEST = 1
CONNECTED = 0
DISCONNECT = 1
GPS_YES ... | 28.273715 | 86 | 0.57764 |
5955113d24d812160700b32a80d74653750634d2 | 10,128 | py | Python | src/pyinfraboxutils/ibflask.py | sap-coutantm/InfraBox | 462b7aca3c730148c5ced6c9fffaa6b3172d1399 | [
"Apache-2.0"
] | null | null | null | src/pyinfraboxutils/ibflask.py | sap-coutantm/InfraBox | 462b7aca3c730148c5ced6c9fffaa6b3172d1399 | [
"Apache-2.0"
] | null | null | null | src/pyinfraboxutils/ibflask.py | sap-coutantm/InfraBox | 462b7aca3c730148c5ced6c9fffaa6b3172d1399 | [
"Apache-2.0"
] | null | null | null | import base64
from functools import wraps
from flask import Flask, g, jsonify, request, abort
from pyinfraboxutils import get_logger
from pyinfraboxutils.db import DB, connect_db
from pyinfraboxutils.token import decode
app = Flask(__name__)
app.url_map.strict_slashes = False
logger = get_logger('ibflask')
def get... | 27.008 | 91 | 0.535742 |
8c4b3a23d177c060b7d7bce971e075d62cca6a82 | 10,091 | py | Python | kerberoast.py | bbhunter/kerberoast | e983ba1d5290e94c71e04fc15dc2cee482873f18 | [
"Apache-2.0"
] | 1,011 | 2015-03-17T21:52:07.000Z | 2022-03-31T09:25:41.000Z | kerberoast.py | bbhunter/kerberoast | e983ba1d5290e94c71e04fc15dc2cee482873f18 | [
"Apache-2.0"
] | 16 | 2015-07-08T09:12:27.000Z | 2022-03-05T19:04:26.000Z | kerberoast.py | bbhunter/kerberoast | e983ba1d5290e94c71e04fc15dc2cee482873f18 | [
"Apache-2.0"
] | 274 | 2015-04-28T21:24:23.000Z | 2022-03-29T18:37:27.000Z | #!/usr/bin/env python3 -tt
import kerberos
from pyasn1.codec.ber import encoder, decoder
from pyasn1.type import univ, useful
import struct
import datetime
import re
import pac
def walk(t):
if type(t) == str:
print('String: %s' % t)
else:
print('Length: %i' % len(t))
for i in range(len(t)):
print('---%i--... | 39.417969 | 708 | 0.742543 |
2dbfc933985e66e4bb63e063ad6bbec4b9455b0c | 542 | py | Python | spacy_lookups_data/tests/test_da.py | spacy-pl/spacy-lookups-data | 54ed95b020a7b0f15df8f872346211d39edf5053 | [
"MIT"
] | null | null | null | spacy_lookups_data/tests/test_da.py | spacy-pl/spacy-lookups-data | 54ed95b020a7b0f15df8f872346211d39edf5053 | [
"MIT"
] | null | null | null | spacy_lookups_data/tests/test_da.py | spacy-pl/spacy-lookups-data | 54ed95b020a7b0f15df8f872346211d39edf5053 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
from spacy.lang.da import Danish
import pytest
@pytest.fixture(scope="session")
def da_nlp():
return Danish()
@pytest.mark.parametrize(
"string,lemma",
[
("affaldsgruppernes", "affaldsgruppe"),
("detailhandelsstrukturernes", "detai... | 21.68 | 64 | 0.673432 |
eba8756b67074da1fe9b580934d4a01057d5a496 | 3,885 | py | Python | gorilla/utils/typing.py | sunjiahao1999/gorilla-core | bf43e3a49c7f79834ae969db38edd50f17ef5288 | [
"MIT"
] | 4 | 2021-07-28T04:50:26.000Z | 2021-09-23T12:59:01.000Z | gorilla/utils/typing.py | sunjiahao1999/gorilla-core | bf43e3a49c7f79834ae969db38edd50f17ef5288 | [
"MIT"
] | null | null | null | gorilla/utils/typing.py | sunjiahao1999/gorilla-core | bf43e3a49c7f79834ae969db38edd50f17ef5288 | [
"MIT"
] | 2 | 2021-08-05T04:01:12.000Z | 2021-12-25T02:17:03.000Z | # Copyright (c) Gorilla-Lab. All rights reserved.
import functools
import torch
import numpy as np
def type_assert(arg):
r"""Assert type in [`list`, `tuple`, `np.array`, `torch.Tensor`]
Args:
arg (instance): instance to be asserted its type
"""
type_flag = isinstance(arg, list) or \
... | 29.884615 | 81 | 0.566281 |
9ee361202b76ca761e174ea96c99ba6b5b3d5d45 | 1,152 | py | Python | PROJECTS/p002/PSEF_SCRIPTS/host_to_type.py | nihole/PSEFABRIC | 366461ab86f99665bf310425c6ce05a216343ec9 | [
"Apache-2.0",
"MIT"
] | 11 | 2017-06-29T10:12:39.000Z | 2020-03-12T07:19:11.000Z | PROJECTS/p002/PSEF_SCRIPTS/host_to_type.py | nihole/PSEFABRIC | 366461ab86f99665bf310425c6ce05a216343ec9 | [
"Apache-2.0",
"MIT"
] | null | null | null | PROJECTS/p002/PSEF_SCRIPTS/host_to_type.py | nihole/PSEFABRIC | 366461ab86f99665bf310425c6ce05a216343ec9 | [
"Apache-2.0",
"MIT"
] | 3 | 2019-04-18T06:44:21.000Z | 2021-06-26T14:22:55.000Z | '''
Adminstrator has to describe the equipment of psefabric.
The mult_cfg.py script uses these dicts in the deciding of how to process the data.
'''
def host_to_type():
host = {}
host['panorama'] = 'pa_panorama'
host['apic_aci_dc1'] = 'cisco_aci'
host['apic_aci_dc2'] = 'cisco_aci'
return host
def ... | 25.6 | 83 | 0.627604 |
543998b5b0c3c7044d68988512771905d81f22f8 | 344 | py | Python | users/filters.py | projeto-cascata/portal-cascata-dev | bffdd0f29fdad25d4c8cf5a2d563e41e621dc205 | [
"MIT"
] | 2 | 2018-04-10T14:13:46.000Z | 2018-12-05T00:19:17.000Z | users/filters.py | projeto-cascata/portal-cascata-dev | bffdd0f29fdad25d4c8cf5a2d563e41e621dc205 | [
"MIT"
] | 26 | 2018-04-04T00:50:13.000Z | 2018-05-20T18:02:34.000Z | users/filters.py | projeto-cascata/portal-cascata-dev | bffdd0f29fdad25d4c8cf5a2d563e41e621dc205 | [
"MIT"
] | null | null | null | from .models import Member
from .models import Student
import django_filters
class MemberFilter(django_filters.FilterSet):
class Meta:
model = Member
fields = ['first_name', 'last_name', ]
class StudentFilter(django_filters.FilterSet):
class Meta:
model = Student
fields = ['fir... | 26.461538 | 46 | 0.688953 |
454e8c1f6dbee85ecdf95027c9775f765e88d5c0 | 4,546 | py | Python | generate_training_data.py | boreshkinai/fc-gaga | 0f6bcf0ce97f23ad331fc6725eaaec0d59051a61 | [
"MIT"
] | 25 | 2020-12-10T02:16:30.000Z | 2022-01-01T11:16:22.000Z | generate_training_data.py | safarzadeh-reza/fc-gaga | 0f6bcf0ce97f23ad331fc6725eaaec0d59051a61 | [
"MIT"
] | 1 | 2021-11-01T21:23:20.000Z | 2022-02-06T19:32:50.000Z | generate_training_data.py | safarzadeh-reza/fc-gaga | 0f6bcf0ce97f23ad331fc6725eaaec0d59051a61 | [
"MIT"
] | 5 | 2021-08-12T16:53:27.000Z | 2022-02-11T18:25:59.000Z | import argparse
import numpy as np
import os
import pandas as pd
def generate_graph_seq2seq_io_data(
df, x_offsets, y_offsets, add_time_in_day=False, add_day_in_week=False, scaler=None
):
"""
Generate samples from
:param df:
:param x_offsets:
:param y_offsets:
:param add_time_in_day:
... | 32.014085 | 117 | 0.611967 |
d717487aa4102ae3687cf9071c840341e2e31d43 | 1,219 | py | Python | auctions/urls.py | KonstantineDM/django-ecommerce-auctions | b0e788d2badd38f3916ff2a740038ece6070f179 | [
"MIT"
] | null | null | null | auctions/urls.py | KonstantineDM/django-ecommerce-auctions | b0e788d2badd38f3916ff2a740038ece6070f179 | [
"MIT"
] | null | null | null | auctions/urls.py | KonstantineDM/django-ecommerce-auctions | b0e788d2badd38f3916ff2a740038ece6070f179 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = "auctions"
urlpatterns = [
path("", views.index, name="index"),
path("login", views.login_view, name="login"),
path("logout", views.logout_view, name="logout"),
path("register", views.register, name="register"),
path("listing/<int:list... | 40.633333 | 103 | 0.711239 |
c8abc39d5f165ba2b54464121c97df4c11be596a | 5,370 | py | Python | setup.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | null | null | null | setup.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | null | null | null | setup.py | krodyush/nncf | 476a274a90a3f2f1ace7a4cb0c9d90d1ddeb7f6a | [
"Apache-2.0"
] | 1 | 2021-04-05T09:33:51.000Z | 2021-04-05T09:33:51.000Z | """
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writin... | 32.944785 | 117 | 0.600931 |
5c1e050d252df0a765cd0e48e1d90b5c0a4f42e2 | 17,432 | py | Python | tests/test_transport/test_rabbit_mq.py | maxipavlovic/django-cqrs | d401819b5bca7c2e833d44e8426251fdd4b6b8b9 | [
"Apache-2.0"
] | null | null | null | tests/test_transport/test_rabbit_mq.py | maxipavlovic/django-cqrs | d401819b5bca7c2e833d44e8426251fdd4b6b8b9 | [
"Apache-2.0"
] | null | null | null | tests/test_transport/test_rabbit_mq.py | maxipavlovic/django-cqrs | d401819b5bca7c2e833d44e8426251fdd4b6b8b9 | [
"Apache-2.0"
] | null | null | null | # Copyright © 2021 Ingram Micro Inc. All rights reserved.
import logging
from datetime import datetime, timedelta, timezone
from importlib import import_module, reload
from dj_cqrs.constants import SignalType
from dj_cqrs.dataclasses import TransportPayload
from dj_cqrs.delay import DelayMessage, DelayQueue
from dj_... | 32.221811 | 99 | 0.686324 |
ec7e323c40507e47f815676d07aee98108747612 | 1,377 | py | Python | ioapi/api_url.py | luisparravicini/ioapi | f9d60a28032fd54163ea15b8256aba1d48ec4dcc | [
"MIT"
] | null | null | null | ioapi/api_url.py | luisparravicini/ioapi | f9d60a28032fd54163ea15b8256aba1d48ec4dcc | [
"MIT"
] | null | null | null | ioapi/api_url.py | luisparravicini/ioapi | f9d60a28032fd54163ea15b8256aba1d48ec4dcc | [
"MIT"
] | 1 | 2020-05-03T04:34:32.000Z | 2020-05-03T04:34:32.000Z | URL_ACCOUNT_STATE = "/api/v2/estadocuenta"
URL_MARKET_RATES = "/api/v2/Cotizaciones/{instrument}/{panel}/{country}"
URL_MUTUAL_FUND = "/api/v2/Titulos/FCI/{symbol}"
URL_MUTUAL_FUND_IN_MARKET = "/api/v2/{market}/Titulos/{symbol}"
URL_MUTUAL_FUND_OPTIONS = "/api/v2/{market}/Titulos/{symbol}/Opciones"
URL_MUTUAL_FUNDS = "... | 57.375 | 109 | 0.77923 |
f13e71efc7ba3129ed52bb13b6addc007ec8774b | 866 | py | Python | polling_stations/apps/data_importers/management/commands/import_cardiff.py | smsmith97/UK-Polling-Stations | ecbd98cb99e89e97354da3960b0063aa36181b11 | [
"BSD-3-Clause"
] | 29 | 2015-03-10T08:41:34.000Z | 2022-01-12T08:51:38.000Z | polling_stations/apps/data_importers/management/commands/import_cardiff.py | smsmith97/UK-Polling-Stations | ecbd98cb99e89e97354da3960b0063aa36181b11 | [
"BSD-3-Clause"
] | 4,112 | 2015-04-01T21:27:38.000Z | 2022-03-31T19:22:11.000Z | polling_stations/apps/data_importers/management/commands/import_cardiff.py | smsmith97/UK-Polling-Stations | ecbd98cb99e89e97354da3960b0063aa36181b11 | [
"BSD-3-Clause"
] | 31 | 2015-03-18T14:52:50.000Z | 2022-02-24T10:31:07.000Z | from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "CRF"
addresses_name = "2021-03-24T16:24:49.782410/cardiff_deduped.tsv"
stations_name = "2021-03-24T16:24:49.782410/cardiff_deduped.tsv"
elections = ["2021... | 27.0625 | 81 | 0.594688 |
1aa9ce05fe3c8c24013d4dba1c29dfc768a7c2f6 | 988 | py | Python | src/main/resources/scripts/crumbDiag.py | MatthewQueenan/vectorcast-execution-plugin | db8d00239db9ab3229c22378727527d4621ca30e | [
"MIT"
] | null | null | null | src/main/resources/scripts/crumbDiag.py | MatthewQueenan/vectorcast-execution-plugin | db8d00239db9ab3229c22378727527d4621ca30e | [
"MIT"
] | null | null | null | src/main/resources/scripts/crumbDiag.py | MatthewQueenan/vectorcast-execution-plugin | db8d00239db9ab3229c22378727527d4621ca30e | [
"MIT"
] | null | null | null | import requests
import sys
import os
verbose=True
try:
username=os.environ['USERNAME']
password=os.environ['PASSWORD']
except:
print "Crumb Diaganostic requires USERNAME/PASSWORD to be set as environment variables"
sys.exit(-1)
jenkins_url=os.environ['JENKINS_URL']
url = jenkins_url + 'crumbIssuer/api/... | 35.285714 | 119 | 0.680162 |
500e5dfffbd885300eded76d1e5248f2991d335d | 3,353 | py | Python | tensorboard/examples/plugins/example_raw_scalars/test.py | BearerPipelineTest/tensorboard | 0fa03a9a8309dc137a15645c931e8b625bc3869c | [
"Apache-2.0"
] | null | null | null | tensorboard/examples/plugins/example_raw_scalars/test.py | BearerPipelineTest/tensorboard | 0fa03a9a8309dc137a15645c931e8b625bc3869c | [
"Apache-2.0"
] | null | null | null | tensorboard/examples/plugins/example_raw_scalars/test.py | BearerPipelineTest/tensorboard | 0fa03a9a8309dc137a15645c931e8b625bc3869c | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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... | 38.988372 | 93 | 0.632568 |
594e1c1b819a42f9c8c8f0daab1b52842ca64dc0 | 11,888 | py | Python | src/yamlfig/test.py | ktkalaru/yamlfig | a6ddb2c8346ae5695402c25921fdc0d2aaa9b3a1 | [
"MIT"
] | 1 | 2021-03-26T08:31:18.000Z | 2021-03-26T08:31:18.000Z | src/yamlfig/test.py | ktkalaru/yamlfig | a6ddb2c8346ae5695402c25921fdc0d2aaa9b3a1 | [
"MIT"
] | null | null | null | src/yamlfig/test.py | ktkalaru/yamlfig | a6ddb2c8346ae5695402c25921fdc0d2aaa9b3a1 | [
"MIT"
] | null | null | null | """Module contains functions that test for common config patterns.
Standard test functions and higher-order functions for use with
yamlfig's rule testing functionality. Function names that begin with
is_* are meant to be passed as the test parameter when instantiating
or adding a YamlConfigRule. Many of the tests in... | 40.573379 | 80 | 0.614401 |
ebdbb4d99f1234c67a9d6887cc0c3694d0cced77 | 1,633 | py | Python | qnn/ansatz/alternating_layer_tdcnot_ansatz.py | bjader/quantum-neural-network | 3f23e14fac8700d3f48593f0727c6da59af5f77f | [
"MIT"
] | 9 | 2021-06-08T14:02:38.000Z | 2022-03-08T10:14:22.000Z | qnn/ansatz/alternating_layer_tdcnot_ansatz.py | bjader/quantum-neural-network | 3f23e14fac8700d3f48593f0727c6da59af5f77f | [
"MIT"
] | null | null | null | qnn/ansatz/alternating_layer_tdcnot_ansatz.py | bjader/quantum-neural-network | 3f23e14fac8700d3f48593f0727c6da59af5f77f | [
"MIT"
] | 1 | 2021-06-12T16:28:53.000Z | 2021-06-12T16:28:53.000Z | from qiskit.circuit import Parameter
from ansatz.variational_ansatz import VariationalAnsatz
class AlternatingLayerTDCnotAnsatz(VariationalAnsatz):
"""
A variational circuit ansatz. Prepares quantum circuit object for variational circuit consisting of thinly
dressed C-NOT gates applied to pairs of qubits... | 39.829268 | 114 | 0.68218 |
7e39818e45c2ed5d3f3e6dcbd5991319b5509f61 | 4,282 | py | Python | DeepJanus-BNG/udacity_integration/train-dataset-recorder-brewer.py | zohdit/DeepJanus | c32022bdff2994e91df7af8af64a022d3e7e6a75 | [
"MIT"
] | 7 | 2020-10-12T10:46:30.000Z | 2021-06-23T10:42:30.000Z | DeepJanus-BNG/udacity_integration/train-dataset-recorder-brewer.py | zohdit/DeepJanus | c32022bdff2994e91df7af8af64a022d3e7e6a75 | [
"MIT"
] | null | null | null | DeepJanus-BNG/udacity_integration/train-dataset-recorder-brewer.py | zohdit/DeepJanus | c32022bdff2994e91df7af8af64a022d3e7e6a75 | [
"MIT"
] | 2 | 2021-04-26T12:46:44.000Z | 2021-09-16T08:27:53.000Z | import random
from time import sleep
from typing import Tuple, List
import numpy as np
from self_driving.beamng_brewer import BeamNGBrewer
from udacity_integration.beamng_car_cameras import BeamNGCarCameras
from self_driving.road_generator import RoadGenerator
from self_driving.beamng_tig_maps import maps
from self_d... | 29.736111 | 111 | 0.656936 |
bb1f1b63a5f1c397cdce0d33921ac4730ce35af9 | 1,150 | py | Python | ecl/tests/functional/network/v2/test_firewall_action.py | keiichi-hikita/eclsdk | c43afb982fd54eb1875cdc22d46044644d804c4a | [
"Apache-2.0"
] | null | null | null | ecl/tests/functional/network/v2/test_firewall_action.py | keiichi-hikita/eclsdk | c43afb982fd54eb1875cdc22d46044644d804c4a | [
"Apache-2.0"
] | null | null | null | ecl/tests/functional/network/v2/test_firewall_action.py | keiichi-hikita/eclsdk | c43afb982fd54eb1875cdc22d46044644d804c4a | [
"Apache-2.0"
] | null | null | null | # 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, software
# distributed under t... | 38.333333 | 75 | 0.714783 |
fde799c38c6dd4393baa13f11529d67e52c8ccd7 | 1,099 | py | Python | scripts/model/__init__.py | heptaliane/DCGanImageGenerator | 691f28a6fa8d141a9da7dce42a8bf507b39c75ed | [
"MIT"
] | null | null | null | scripts/model/__init__.py | heptaliane/DCGanImageGenerator | 691f28a6fa8d141a9da7dce42a8bf507b39c75ed | [
"MIT"
] | null | null | null | scripts/model/__init__.py | heptaliane/DCGanImageGenerator | 691f28a6fa8d141a9da7dce42a8bf507b39c75ed | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import torch
from .dcgan_generator import DCGanGenerator
from .dcgan_discriminator import DCGanDiscriminator
# Logging
from logging import getLogger, NullHandler
logger = getLogger(__name__)
logger.addHandler(NullHandler())
def _reshape_state_dict(src, target):
assert src.dim(... | 25.55814 | 62 | 0.640582 |
332f48ee48a686597c94d29190b8b58b8a1048e4 | 4,899 | py | Python | scripts/gen_deinter_lut.py | andreaskuster/openofdm | 0c39b31b808dd257cfc0696c8c4dd51dfd745edb | [
"Apache-2.0"
] | 1 | 2022-01-14T15:31:11.000Z | 2022-01-14T15:31:11.000Z | scripts/gen_deinter_lut.py | bby0616/ofdm | 8d9bfb692e9c1f45f9e3cf98eaef479616442716 | [
"Apache-2.0"
] | null | null | null | scripts/gen_deinter_lut.py | bby0616/ofdm | 8d9bfb692e9c1f45f9e3cf98eaef479616442716 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
Generate 802.11a/g/n Deinterleave LUT.
Output compensate for pucntureing.
"""
import argparse
import math
import os
import decode
"""
LUT ENTRY FORMAT
1 bit -- null_a
1 bit -- null_b
6 bit -- addra
6 bit -- addrb
3 bit -- bita
3 bit -- bitb
1 bit -- out_stb
1 bit -- done
-------------... | 21.581498 | 82 | 0.423352 |
4df63b98a03ecc20ec1bb3b9f03fc78127edd480 | 2,901 | py | Python | StockPortfolio/runportfolio.py | jedpittman/python_samples | e3d0271e10cf981f7a0ff39f1e28edf26c12bcef | [
"MIT"
] | null | null | null | StockPortfolio/runportfolio.py | jedpittman/python_samples | e3d0271e10cf981f7a0ff39f1e28edf26c12bcef | [
"MIT"
] | null | null | null | StockPortfolio/runportfolio.py | jedpittman/python_samples | e3d0271e10cf981f7a0ff39f1e28edf26c12bcef | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import requests
from pypfopt.efficient_frontier import EfficientFrontier
from pypfopt import risk_models
from pypfopt import expected_returns
#load the data
# from google.colab import files
# files.upload()
# Store the data
df = pd.read_csv("data\FakeStockData.csv")
# df = pd.re... | 29.30303 | 109 | 0.759393 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.