hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8908d261e8e38c35bb6884e8180c3cd5e28a2b89 | 33 | py | Python | pricegen/__init__.py | mahiro/python-pricegen | 89fa697554c3fcf6dc488775ba894eba53415973 | [
"MIT"
] | null | null | null | pricegen/__init__.py | mahiro/python-pricegen | 89fa697554c3fcf6dc488775ba894eba53415973 | [
"MIT"
] | null | null | null | pricegen/__init__.py | mahiro/python-pricegen | 89fa697554c3fcf6dc488775ba894eba53415973 | [
"MIT"
] | null | null | null | from pricegen.generator import *
| 16.5 | 32 | 0.818182 |
5483cdf867cc7e39e862986f2417cf80907ffef8 | 2,694 | py | Python | ws4py/__init__.py | soulgalore/wptagent | a26b2b1135e34d458f9d332b8a338bc013d51203 | [
"Apache-2.0"
] | 2 | 2020-10-28T09:42:03.000Z | 2022-02-07T14:11:50.000Z | ws4py/__init__.py | soulgalore/wptagent | a26b2b1135e34d458f9d332b8a338bc013d51203 | [
"Apache-2.0"
] | 4 | 2021-07-22T10:28:37.000Z | 2022-03-10T13:56:51.000Z | ws4py/__init__.py | soulgalore/wptagent | a26b2b1135e34d458f9d332b8a338bc013d51203 | [
"Apache-2.0"
] | 1 | 2020-10-10T04:39:35.000Z | 2020-10-10T04:39:35.000Z | # -*- coding: utf-8 -*-
#
# 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 following disclaimer.
# * ... | 39.617647 | 90 | 0.729027 |
e6c92cf1f30f96588c2fb9d4b6a8581756b65816 | 343 | py | Python | thoughts/commands/random.py | hofmanniac/thoughts | de3a63ac79a253139f014e89606dae6d98cfa80d | [
"MIT"
] | null | null | null | thoughts/commands/random.py | hofmanniac/thoughts | de3a63ac79a253139f014e89606dae6d98cfa80d | [
"MIT"
] | null | null | null | thoughts/commands/random.py | hofmanniac/thoughts | de3a63ac79a253139f014e89606dae6d98cfa80d | [
"MIT"
] | null | null | null | import random
from thoughts import context as ctx
def process(command, context):
random_set = command["#random"]
if (type(random_set) is list):
max = len(random_set)
r = random.randint(0, max-1)
item = random_set[r]
ctx.Context.store_item(context, command, item)
... | 24.5 | 54 | 0.629738 |
3f94259acf9da229dcaf85a9ad01ea8d89524920 | 641 | py | Python | phraseless/contrib/django/views.py | jocke-l/phraseless | 47b3dcc434a4a12e9cb668d7ae527c3a5478dada | [
"BSD-3-Clause"
] | null | null | null | phraseless/contrib/django/views.py | jocke-l/phraseless | 47b3dcc434a4a12e9cb668d7ae527c3a5478dada | [
"BSD-3-Clause"
] | null | null | null | phraseless/contrib/django/views.py | jocke-l/phraseless | 47b3dcc434a4a12e9cb668d7ae527c3a5478dada | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.auth import authenticate as authenticate_
from django.http import HttpResponse
from phraseless.contrib.django.forms import CertificateAuth
def authenticate(request):
form = CertificateAuth(request.POST)
if form.is_valid():
user = authenticate_(
request,
cer... | 24.653846 | 69 | 0.667707 |
51ec7ee8d855982fba1536aa09dc8d909503147e | 153 | py | Python | src/selfpub/outp/__init__.py | groboclown/py-book-selfpub | 42060d8bca7c7d281801fe6836f238f41df872e3 | [
"Apache-2.0"
] | null | null | null | src/selfpub/outp/__init__.py | groboclown/py-book-selfpub | 42060d8bca7c7d281801fe6836f238f41df872e3 | [
"Apache-2.0"
] | null | null | null | src/selfpub/outp/__init__.py | groboclown/py-book-selfpub | 42060d8bca7c7d281801fe6836f238f41df872e3 | [
"Apache-2.0"
] | null | null | null |
from .output import OutputFile
from .mobi import MobiOutput
from .epub import EPubOutput
from .html import HtmlOutput
from .zip_gen import ZipGenOutput
| 21.857143 | 33 | 0.830065 |
be1d51e137b7a7db7ce68b037764241cc09f33f0 | 6,068 | py | Python | src/test.py | k8lion/admmdarts | 4953e401cb74ba9f8da3ed0b9d4c5e88da9fc776 | [
"Apache-2.0"
] | null | null | null | src/test.py | k8lion/admmdarts | 4953e401cb74ba9f8da3ed0b9d4c5e88da9fc776 | [
"Apache-2.0"
] | null | null | null | src/test.py | k8lion/admmdarts | 4953e401cb74ba9f8da3ed0b9d4c5e88da9fc776 | [
"Apache-2.0"
] | null | null | null | import argparse
import logging
import os
import sys
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.utils
import torchvision.datasets as dset
from torch.autograd import Variable
import utils
from model import NetworkCIFAR as Network
from genotypes import *
# te... | 38.649682 | 106 | 0.691496 |
4e17210ce1147c8d9eb9649ccae537f925a57dee | 1,492 | py | Python | asana_app/asana_utils.py | maksim-shaidulin/asana | bd23a0a794ce7aafe31e9df1de9c7606f32504f4 | [
"MIT"
] | null | null | null | asana_app/asana_utils.py | maksim-shaidulin/asana | bd23a0a794ce7aafe31e9df1de9c7606f32504f4 | [
"MIT"
] | null | null | null | asana_app/asana_utils.py | maksim-shaidulin/asana | bd23a0a794ce7aafe31e9df1de9c7606f32504f4 | [
"MIT"
] | null | null | null | import os
import asana
class AsanaApiUtils:
def __init__(self):
self.client = asana.Client.access_token(os.environ.get('ASANA_PERSONAL_TOKEN'))
self.workspace_gid = self.get_default_workspace()['gid']
def get_default_workspace(self):
workspaces = self.client.workspaces.get_workspaces(... | 34.697674 | 87 | 0.655496 |
e4fce052fbb8b0fdff7281439eb9bbe2eaeb9348 | 9,320 | py | Python | VQ3D/camera_pose_estimation/pnp_api.py | emulhall/episodic-memory | 27bafec6e09c108f0efe5ac899eabde9d1ac40cc | [
"MIT"
] | 27 | 2021-10-16T02:39:17.000Z | 2022-03-31T11:16:11.000Z | VQ3D/camera_pose_estimation/pnp_api.py | emulhall/episodic-memory | 27bafec6e09c108f0efe5ac899eabde9d1ac40cc | [
"MIT"
] | 5 | 2022-03-23T04:53:36.000Z | 2022-03-29T23:39:07.000Z | VQ3D/camera_pose_estimation/pnp_api.py | emulhall/episodic-memory | 27bafec6e09c108f0efe5ac899eabde9d1ac40cc | [
"MIT"
] | 13 | 2021-11-25T19:17:29.000Z | 2022-03-25T14:01:47.000Z | import torch
import fnmatch
import argparse
import numpy as np
from torch.utils.data.dataset import Dataset
import os
from torch.utils.data import DataLoader
from tqdm import tqdm
import cv2
from utils import WritePosesToPly
def PnP(x1s, f3ds, x2s, m1_ids, K1, K2, thres=1e-2):
f2d = [] # keep only feature points w... | 41.057269 | 129 | 0.592704 |
aedc08088f4b46e83fd19fbb1bda7745f8488eae | 7,368 | py | Python | allennlp/modules/seq2seq_encoders/intra_sentence_attention.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 65 | 2020-11-13T05:36:29.000Z | 2022-03-26T22:45:46.000Z | allennlp/modules/seq2seq_encoders/intra_sentence_attention.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 11 | 2021-05-26T16:22:17.000Z | 2022-03-02T04:03:18.000Z | allennlp/modules/seq2seq_encoders/intra_sentence_attention.py | annaproxy/udify-metalearning | 55206a3aac0aba74a3615a36192d03b6467cfd6f | [
"MIT"
] | 10 | 2019-12-06T11:32:37.000Z | 2022-01-06T15:39:09.000Z | from overrides import overrides
import torch
from torch.nn import Linear
from allennlp.common.checks import ConfigurationError
from allennlp.modules.matrix_attention.legacy_matrix_attention import LegacyMatrixAttention
from allennlp.modules.seq2seq_encoders.seq2seq_encoder import Seq2SeqEncoder
from allennlp.modules.s... | 53.007194 | 102 | 0.687296 |
3abdc091320cd9227eb93207da5e21b8bdef0665 | 6,697 | py | Python | sdk/search/azure-search-documents/azure/search/documents/__init__.py | SnehaGunda/azure-sdk-for-python | 88fae6ec703ac3641459b5d07158c9ed710524fe | [
"MIT"
] | 1 | 2020-05-12T23:29:15.000Z | 2020-05-12T23:29:15.000Z | sdk/search/azure-search-documents/azure/search/documents/__init__.py | SnehaGunda/azure-sdk-for-python | 88fae6ec703ac3641459b5d07158c9ed710524fe | [
"MIT"
] | null | null | null | sdk/search/azure-search-documents/azure/search/documents/__init__.py | SnehaGunda/azure-sdk-for-python | 88fae6ec703ac3641459b5d07158c9ed710524fe | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | 26.895582 | 78 | 0.712409 |
8f7e95a0701c2f48fff14425fccd818f15c68d41 | 727 | py | Python | selenium_tests/Tests/TestSuiteWithinPage/test_LoginPage.py | avielfedida/RoboAdvisor | ca8ba3c479f5fd3ae1e468f11f09ecf08e2a0cf9 | [
"MIT"
] | null | null | null | selenium_tests/Tests/TestSuiteWithinPage/test_LoginPage.py | avielfedida/RoboAdvisor | ca8ba3c479f5fd3ae1e468f11f09ecf08e2a0cf9 | [
"MIT"
] | 3 | 2020-12-31T08:03:30.000Z | 2021-03-30T06:39:50.000Z | selenium_tests/Tests/TestSuiteWithinPage/test_LoginPage.py | avielfedida/RoboAdvisor | ca8ba3c479f5fd3ae1e468f11f09ecf08e2a0cf9 | [
"MIT"
] | 1 | 2021-06-20T09:13:03.000Z | 2021-06-20T09:13:03.000Z | import pytest
from selenium_tests.Data.SiteMessages import SiteMessages
from selenium_tests.Pages.LoginPage import LoginPage
from selenium_tests.utils import get_random_username_password
@pytest.mark.usefixtures("tear_up_down")
class Test_LoginPage:
def test_crucial_elements_visibility(self):
page = Log... | 33.045455 | 83 | 0.774415 |
368c1af3f06fa7c67aacd0c92fc5a91e2b30c148 | 13,595 | py | Python | stsci/skypac/region.py | mcara/stsci.skypac | b986e41a29c3c2536cea86a62802b39f71e5588c | [
"BSD-3-Clause"
] | 1 | 2019-01-17T08:02:17.000Z | 2019-01-17T08:02:17.000Z | stsci/skypac/region.py | mcara/stsci.skypac | b986e41a29c3c2536cea86a62802b39f71e5588c | [
"BSD-3-Clause"
] | 21 | 2017-02-03T05:17:49.000Z | 2021-06-07T14:47:29.000Z | stsci/skypac/region.py | mcara/stsci.skypac | b986e41a29c3c2536cea86a62802b39f71e5588c | [
"BSD-3-Clause"
] | 5 | 2016-03-29T19:57:14.000Z | 2018-06-13T14:04:07.000Z | """
Polygon filling algorithm.
:Authors: Nadezhda Dencheva, Mihai Cara
:License: :doc:`LICENSE`
"""
# Original author: Nadezhda Dencheva
#
# modifications by Mihai Cara: removed functionality not needed for the
# skymatch algorithm and modified the code to be able to work with polygons
# that have vertices with nega... | 30.897727 | 82 | 0.556602 |
ffa13826157da82f4e19f409b1d116a7600cd8bc | 1,141 | py | Python | nn_layers/ffn.py | alibalapour/HATNet | 9dc4a2203bf51c1d834e20500153402968bcf54e | [
"MIT"
] | 25 | 2020-07-26T12:26:26.000Z | 2022-01-24T11:06:28.000Z | nn_layers/ffn.py | alibalapour/HATNet | 9dc4a2203bf51c1d834e20500153402968bcf54e | [
"MIT"
] | 1 | 2021-11-29T09:54:17.000Z | 2022-01-08T13:40:40.000Z | nn_layers/ffn.py | sacmehta/HATNet | c4e50746f68140068bae75a6b07525046255d0b5 | [
"MIT"
] | 9 | 2020-11-18T18:38:21.000Z | 2021-12-11T01:31:50.000Z | '''
This file implements the Feed forward network
Adapted from OpenNMT-Py
'''
from torch import nn
class FFN(nn.Module):
def __init__(self, input_dim, scale, output_dim=None, p=0.1, expansion=False):
super(FFN, self).__init__()
output_dim = input_dim if output_dim is None else output_dim
... | 34.575758 | 82 | 0.640666 |
5faae59fb8472b66ebcc0b0821a58d3b275c0dc2 | 642 | py | Python | Python Advanced/exams/fucntion-exam-01/flights_Retake Exam - 14 April 2021.py | bvoytash/Software-University | f2c6940cde093cea7b1c38bd88305206564c9947 | [
"MIT"
] | null | null | null | Python Advanced/exams/fucntion-exam-01/flights_Retake Exam - 14 April 2021.py | bvoytash/Software-University | f2c6940cde093cea7b1c38bd88305206564c9947 | [
"MIT"
] | null | null | null | Python Advanced/exams/fucntion-exam-01/flights_Retake Exam - 14 April 2021.py | bvoytash/Software-University | f2c6940cde093cea7b1c38bd88305206564c9947 | [
"MIT"
] | null | null | null | def flights(*args):
my_dict = {}
for index, el in enumerate(args):
if not el == "Finish":
if isinstance(el, str):
if not el in my_dict:
my_dict[el] = args[index + 1]
else:
my_dict[el] += args[index + 1]
else:
... | 37.764706 | 110 | 0.520249 |
19a8490275d3b994d1a49a88f89d996d1ef062c6 | 617 | py | Python | py_learning/python_demo/63/pachong2.py | flylei009/python_learning | 9d55a296dc56d6f2295d53f2c4be55724cc8fea3 | [
"MIT"
] | 1 | 2020-09-20T04:02:38.000Z | 2020-09-20T04:02:38.000Z | py_learning/python_demo/63/pachong2.py | flylei009/python_learning | 9d55a296dc56d6f2295d53f2c4be55724cc8fea3 | [
"MIT"
] | null | null | null | py_learning/python_demo/63/pachong2.py | flylei009/python_learning | 9d55a296dc56d6f2295d53f2c4be55724cc8fea3 | [
"MIT"
] | null | null | null | from urllib import parse
from urllib import request
data = bytes(parse.urlencode({'word':'hello'}),encoding='utf8')
# print(data)
response = request.urlopen('http://httpbin.org/post', data=data)
print(response.read().decode('utf-8'))
response2 = request.urlopen('http://httpbin.org/get', timeout=1)
print(response2.r... | 24.68 | 77 | 0.714749 |
a41283edede130c627554c607235c007e62c60c7 | 11,504 | py | Python | localProxy.py | Qogir-Chiu/swift-proxy | f3459db71eb1073e8fac22e1f69d3b9315dd6f48 | [
"MIT"
] | null | null | null | localProxy.py | Qogir-Chiu/swift-proxy | f3459db71eb1073e8fac22e1f69d3b9315dd6f48 | [
"MIT"
] | null | null | null | localProxy.py | Qogir-Chiu/swift-proxy | f3459db71eb1073e8fac22e1f69d3b9315dd6f48 | [
"MIT"
] | 1 | 2021-04-17T03:14:57.000Z | 2021-04-17T03:14:57.000Z | '''
Copyright (c)2020, by Qogir, JMJ, MA71
All rights reserved.
File Name: LocalProxy
System Name: SwiftProxy
Date: 2020-12-01
Version: 1.0
Description: 本地代理服务器。该模块主要依赖asyncio和websockets库,并使用协程/单线程异步IO的思想进行编程,是本程序的核心模块.
'''
import argparse
import asyncio
import ipaddress
import json
import logging
import si... | 40.364912 | 132 | 0.638039 |
96c06f66cf4fee3e395d16c70574d64bdd018e43 | 1,745 | py | Python | akshare/stock_feature/stock_a_high_low.py | J-Z-Z/akshare | 0a9ca71b381a272e2f56211e455ff2493dfed17a | [
"MIT"
] | 721 | 2021-09-21T12:10:33.000Z | 2022-03-31T09:47:01.000Z | akshare/stock_feature/stock_a_high_low.py | J-Z-Z/akshare | 0a9ca71b381a272e2f56211e455ff2493dfed17a | [
"MIT"
] | 135 | 2021-09-21T12:07:54.000Z | 2022-03-31T14:15:36.000Z | akshare/stock_feature/stock_a_high_low.py | J-Z-Z/akshare | 0a9ca71b381a272e2f56211e455ff2493dfed17a | [
"MIT"
] | 234 | 2021-09-21T12:16:27.000Z | 2022-03-31T09:47:04.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2021/12/19 13:32
Desc: 乐咕乐股-创新高、新低的股票数量
https://www.legulegu.com/stockdata/high-low-statistics
"""
import pandas as pd
import requests
def stock_a_high_low_statistics(symbol: str = "all") -> pd.DataFrame:
"""
乐咕乐股-创新高、新低的股票数量
https://www.legulegu.com/... | 34.9 | 96 | 0.706017 |
f989049ca1a2d92a5f2fad4af1f8254a3de43597 | 4,236 | py | Python | test_autofit/non_linear/grid/test_paths/test_indicators.py | rhayes777/AutoFit | f5d769755b85a6188ec1736d0d754f27321c2f06 | [
"MIT"
] | null | null | null | test_autofit/non_linear/grid/test_paths/test_indicators.py | rhayes777/AutoFit | f5d769755b85a6188ec1736d0d754f27321c2f06 | [
"MIT"
] | null | null | null | test_autofit/non_linear/grid/test_paths/test_indicators.py | rhayes777/AutoFit | f5d769755b85a6188ec1736d0d754f27321c2f06 | [
"MIT"
] | null | null | null | from pathlib import Path
import pytest
import autofit as af
from autoconf.conf import output_path_for_test
from autofit.database.aggregator.scrape import Scraper
output_directory = Path(
__file__
).parent / "output"
@pytest.fixture(
name="parent_search"
)
@output_path_for_test(
output_directory
)
def m... | 20.764706 | 82 | 0.631256 |
53744ab0a2a0b1760576ef3d90eb2c443dd2256c | 6,592 | py | Python | venv/Lib/hmac.py | rchangdar/Django-WebApp | 7f5e08ba5892b73f84c885ad805605985a5c542a | [
"MIT"
] | null | null | null | venv/Lib/hmac.py | rchangdar/Django-WebApp | 7f5e08ba5892b73f84c885ad805605985a5c542a | [
"MIT"
] | null | null | null | venv/Lib/hmac.py | rchangdar/Django-WebApp | 7f5e08ba5892b73f84c885ad805605985a5c542a | [
"MIT"
] | null | null | null | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
from _operator import _compare_digest as compare_digest
try:
import _hashlib as _hashopenssl
except ImportError:
_hashopenssl = None
_openss... | 35.251337 | 97 | 0.60361 |
a369b50d9d9d2ed07d9522087cbc852ecc5b10e3 | 103,205 | py | Python | modules/s3db/msg.py | flavour/RMSYemen | 0fa7ecd3259e1d051193ef26a9d2999e67695b8f | [
"MIT"
] | 27 | 2015-01-13T23:52:49.000Z | 2016-01-11T08:08:45.000Z | modules/s3db/msg.py | flavour/RMSYemen | 0fa7ecd3259e1d051193ef26a9d2999e67695b8f | [
"MIT"
] | 140 | 2015-01-01T07:38:10.000Z | 2016-03-01T10:51:54.000Z | modules/s3db/msg.py | flavour/RMSYemen | 0fa7ecd3259e1d051193ef26a9d2999e67695b8f | [
"MIT"
] | 109 | 2015-01-02T17:36:17.000Z | 2016-02-07T14:49:28.000Z | # -*- coding: utf-8 -*-
""" Sahana Eden Messaging Model
@copyright: 2009-2019 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software wit... | 39.542146 | 141 | 0.394458 |
8aa8c4ec1edd50aad7cce4dff8e8d3195f7e67cb | 4,122 | py | Python | app/classifiers/color_classifier/color_classifer.py | Stosan/api-ris | 41f40787d4e1eb44aaea019a99f9721ff38bd18a | [
"MIT"
] | null | null | null | app/classifiers/color_classifier/color_classifer.py | Stosan/api-ris | 41f40787d4e1eb44aaea019a99f9721ff38bd18a | [
"MIT"
] | null | null | null | app/classifiers/color_classifier/color_classifer.py | Stosan/api-ris | 41f40787d4e1eb44aaea019a99f9721ff38bd18a | [
"MIT"
] | null | null | null | import datetime
import base64
import json
import os
from io import BytesIO
import pandas as pd
import numpy as np
import PIL.Image as img
from colorthief import ColorThief
from keras.models import load_model
from pathlib import Path
class ColorClassifier:
def __init__(self):
self.path_to_artifacts = "app/c... | 37.472727 | 158 | 0.586851 |
9d5dbaa251ba6ceb296c5e450eb74e0924ec6df5 | 10,443 | py | Python | skika/data/hyper_plane_generator_redund.py | cpearce/scikit-ika | 01f90ac3e7963e4d05f73316a7d14de0d8f08d1e | [
"BSD-3-Clause"
] | 4 | 2020-04-29T03:36:36.000Z | 2021-09-01T02:46:19.000Z | skika/data/hyper_plane_generator_redund.py | cpearce/scikit-ika | 01f90ac3e7963e4d05f73316a7d14de0d8f08d1e | [
"BSD-3-Clause"
] | 2 | 2020-05-04T07:46:31.000Z | 2022-03-14T20:28:25.000Z | skika/data/hyper_plane_generator_redund.py | cpearce/scikit-ika | 01f90ac3e7963e4d05f73316a7d14de0d8f08d1e | [
"BSD-3-Clause"
] | 3 | 2020-02-21T00:27:32.000Z | 2020-05-04T07:04:35.000Z | # Modified version of scikit-multiflow code to include generation of redundant attributes
import numpy as np
from skmultiflow.data.base_stream import Stream
from skmultiflow.utils import check_random_state
import math
class HyperplaneGeneratorRedund(Stream):
""" Hyperplane stream generator.
Modified version... | 35.520408 | 157 | 0.630949 |
af569e57ff54e852e1504f5cd095cadacb30058e | 1,863 | py | Python | tests/flexical/text_processing/test_bow.py | renanlage/flexical | 31143b17266eee4c4e9e7103c2ee7b81733f5fd5 | [
"MIT"
] | null | null | null | tests/flexical/text_processing/test_bow.py | renanlage/flexical | 31143b17266eee4c4e9e7103c2ee7b81733f5fd5 | [
"MIT"
] | null | null | null | tests/flexical/text_processing/test_bow.py | renanlage/flexical | 31143b17266eee4c4e9e7103c2ee7b81733f5fd5 | [
"MIT"
] | null | null | null | from unittest.case import TestCase
from flexical.text_processing.bow import BowGenerator
class BowTest(TestCase):
def test_return_expected_bow_if_mask_is_not_applied(self):
docs = [u'grande coisa essa coisa nao muito grande se o mundo acabar'.split(), [u'doideira', u'isso']]
bow_generator = BowG... | 45.439024 | 110 | 0.613527 |
8b565d0c3fa6b86a5d81db7c44ace217267fb951 | 789 | py | Python | web/core/migrations/0142_auto_20210510_1046.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | 4 | 2020-03-22T18:13:12.000Z | 2021-01-25T10:33:31.000Z | web/core/migrations/0142_auto_20210510_1046.py | MTES-MCT/carbure | 2876756b760ab4866fa783bb40e61a046eebb1ab | [
"MIT"
] | 20 | 2020-07-06T14:33:14.000Z | 2022-03-15T16:54:17.000Z | web/core/migrations/0142_auto_20210510_1046.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | 4 | 2020-04-03T12:19:12.000Z | 2021-06-15T12:20:57.000Z | # Generated by Django 3.2 on 2021-05-10 08:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0141_auto_20210510_1044'),
]
operations = [
migrations.AlterField(
model_name='lottransaction',
name='delivery... | 32.875 | 188 | 0.572877 |
93fa7b49050e541a808b9d96c46729249722d248 | 4,520 | py | Python | thonny/plugins/goto_definition.py | jharris1993/thonny | acc9ee88ebb9eebdfe72c543a39346a5256f53ff | [
"MIT"
] | 1 | 2022-02-09T06:25:31.000Z | 2022-02-09T06:25:31.000Z | thonny/plugins/goto_definition.py | jharris1993/thonny | acc9ee88ebb9eebdfe72c543a39346a5256f53ff | [
"MIT"
] | null | null | null | thonny/plugins/goto_definition.py | jharris1993/thonny | acc9ee88ebb9eebdfe72c543a39346a5256f53ff | [
"MIT"
] | null | null | null | from logging import getLogger
import os.path
import tkinter as tk
from tkinter import messagebox
from typing import cast, Set
from thonny import get_workbench, get_runner
from thonny.codeview import CodeViewText, SyntaxText
from thonny.common import InlineCommand
from thonny.editor_helpers import get_text_filename, ge... | 38.305085 | 100 | 0.630752 |
e3374ba6d354cebd76b34dd7f64b2f415e9529d3 | 717 | py | Python | raw/day02/part1.py | aesdeef/advent-of-code-2021 | 4561bcf12ac03d360f5b28c48ef80134f97613b9 | [
"MIT"
] | 2 | 2021-12-03T06:18:27.000Z | 2021-12-06T11:28:33.000Z | raw/day02/part1.py | aesdeef/advent-of-code-2021 | 4561bcf12ac03d360f5b28c48ef80134f97613b9 | [
"MIT"
] | null | null | null | raw/day02/part1.py | aesdeef/advent-of-code-2021 | 4561bcf12ac03d360f5b28c48ef80134f97613b9 | [
"MIT"
] | null | null | null | hor = 0
dep = 0
with open("../../input/02.txt", "r") as f:
for line in f:
match line.strip().split():
case ["forward", num]:
hor += int(num)
case ["down", num]:
dep += int(num)
case ["up", num]:
dep -= int(num)
print(hor, d... | 23.9 | 42 | 0.404463 |
c56dc4ba101de02fd03464262394bf4095af5c5c | 15,067 | py | Python | ensembles/TrnBK_TstBK/ESNtrainCV.py | malfarasplux/pnet2019 | ae34d5c84fb4d3985634b237a14dfb69e98b8339 | [
"BSD-3-Clause"
] | 1 | 2020-11-29T12:42:30.000Z | 2020-11-29T12:42:30.000Z | ensembles/TrnBK_TstBK/ESNtrainCV.py | malfarasplux/pnet2019 | ae34d5c84fb4d3985634b237a14dfb69e98b8339 | [
"BSD-3-Clause"
] | null | null | null | ensembles/TrnBK_TstBK/ESNtrainCV.py | malfarasplux/pnet2019 | ae34d5c84fb4d3985634b237a14dfb69e98b8339 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
## Config
# biased_regress = True
# normal_equations = True
dataset = "training_1"
path = "../" + dataset +"/"
kfold_split = 10
nan_to_zero = True
mm = False
std = False
numpy_load = True
nanfill = False
## ESN parameters
N_def = [100] ... | 33.706935 | 165 | 0.584655 |
b8d22fb7c58215b6af276e4f37580536cd6d230f | 5,472 | py | Python | examples/start2.py | beidongjiedeguang/manim-express | e9c89b74da3692db3ea9b568727e78d5cbcef503 | [
"MIT"
] | 12 | 2021-06-14T07:28:29.000Z | 2022-02-25T02:49:49.000Z | examples/start2.py | beidongjiedeguang/manim-kunyuan | e9c89b74da3692db3ea9b568727e78d5cbcef503 | [
"MIT"
] | 1 | 2022-02-01T12:30:14.000Z | 2022-02-01T12:30:14.000Z | examples/start2.py | beidongjiedeguang/manim-express | e9c89b74da3692db3ea9b568727e78d5cbcef503 | [
"MIT"
] | 2 | 2021-05-13T13:24:15.000Z | 2021-05-18T02:56:22.000Z | from manimlib import *
import os
class SquareToCircle(Scene):
def construct(self):
circle = Circle()
circle.set_fill(BLUE, opacity=0.5)
circle.set_stroke(BLUE_E, width=4)
square = Square()
self.play(ShowCreation(square))
self.wait()
# self.play(ReplacementTr... | 32.571429 | 156 | 0.606542 |
e60a492d6e6274ad455d3d829e092347263284d5 | 550 | py | Python | Python/5928.py | GeneralLi95/leetcode | f42392f2283e19ec76273d81b2912944f9039568 | [
"MIT"
] | null | null | null | Python/5928.py | GeneralLi95/leetcode | f42392f2283e19ec76273d81b2912944f9039568 | [
"MIT"
] | null | null | null | Python/5928.py | GeneralLi95/leetcode | f42392f2283e19ec76273d81b2912944f9039568 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
class Solution:
def decodeCiphertext(self, encodedText: str, rows: int) -> str:
col = len(encodedText) // rows
aaa = list(encodedText)
# cube = [['*' for j in range(col)] for i in range(rows)]
# for i in range(rows):
# for j in range(col):
# cube[i][j] = aaa.pop(0)
result = ''
... | 22.916667 | 64 | 0.589091 |
602ecb66633af3f1c4c017c695a7f8b84fd3b7de | 4,197 | py | Python | contrib/seeds/generate-seeds.py | wavercoin/core-project | 48cc42ce5ad314c9672e6ccb854b497128d17781 | [
"MIT"
] | 2 | 2019-04-08T01:45:35.000Z | 2019-06-01T01:34:10.000Z | contrib/seeds/generate-seeds.py | wavercoin/core-project | 48cc42ce5ad314c9672e6ccb854b497128d17781 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | wavercoin/core-project | 48cc42ce5ad314c9672e6ccb854b497128d17781 | [
"MIT"
] | 1 | 2021-09-06T19:33:50.000Z | 2021-09-06T19:33:50.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.088889 | 98 | 0.580891 |
86f393e8676b4ebe60a9ce8976c44b09f96e3fff | 2,426 | py | Python | research/carls/context_test.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 939 | 2019-08-28T06:50:30.000Z | 2022-03-30T02:37:07.000Z | research/carls/context_test.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 80 | 2019-09-01T19:47:30.000Z | 2022-02-02T20:38:38.000Z | research/carls/context_test.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 196 | 2019-09-01T19:38:53.000Z | 2022-02-08T01:25:57.000Z | # Copyright 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.323077 | 74 | 0.755565 |
10de67d8b1bab9e6e2795ec03f9b0cb0cb351785 | 12,375 | py | Python | basinmaker/addattributes/addattributestocatchments.py | dustming/basinmaker | 9a49f4aa3daabf98fb1af61423e4c54309bd1417 | [
"Artistic-2.0"
] | 4 | 2021-04-07T19:26:55.000Z | 2022-03-26T01:03:54.000Z | basinmaker/addattributes/addattributestocatchments.py | dustming/basinmaker | 9a49f4aa3daabf98fb1af61423e4c54309bd1417 | [
"Artistic-2.0"
] | 4 | 2021-04-08T04:31:06.000Z | 2021-04-09T15:02:50.000Z | basinmaker/addattributes/addattributestocatchments.py | dustming/basinmaker | 9a49f4aa3daabf98fb1af61423e4c54309bd1417 | [
"Artistic-2.0"
] | null | null | null | from basinmaker.utilities.utilities import *
from basinmaker.func.pdtable import *
def add_attributes_to_catchments(
input_geo_names,
path_bkfwidthdepth="#",
bkfwd_attributes=[],
path_landuse="#",
path_landuse_info="#",
path_k_c_zone_polygon = '#',
k_in=-1,
c_in=-1,
out_cat_name="c... | 41.25 | 97 | 0.632323 |
bae02accdd374bbe5af9e3100b09092ccd36caa4 | 23,872 | py | Python | litex/soc/interconnect/wishbone.py | umarcor/litex | 1d20bbcd01784158088e1eb85e219309cfce0248 | [
"ADSL"
] | 1 | 2021-12-25T13:49:55.000Z | 2021-12-25T13:49:55.000Z | litex/soc/interconnect/wishbone.py | umarcor/litex | 1d20bbcd01784158088e1eb85e219309cfce0248 | [
"ADSL"
] | null | null | null | litex/soc/interconnect/wishbone.py | umarcor/litex | 1d20bbcd01784158088e1eb85e219309cfce0248 | [
"ADSL"
] | 1 | 2021-12-25T13:49:57.000Z | 2021-12-25T13:49:57.000Z | #
# This file is part of LiteX.
#
# Copyright (c) 2015 Sebastien Bourdeauducq <sb@m-labs.hk>
# Copyright (c) 2015-2020 Florent Kermarrec <florent@enjoy-digital.fr>
# Copyright (c) 2018 Tim 'mithro' Ansell <me@mith.ro>
# Copytight (c) 2022 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: BSD-2-Clause
"""Wishbone ... | 35.471025 | 103 | 0.522914 |
2211083a1a8e26f86e11508e893a4b7340372f23 | 5,313 | py | Python | ansible/my_env/lib/python2.7/site-packages/ansible/plugins/action/ce.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 1 | 2019-04-16T21:23:15.000Z | 2019-04-16T21:23:15.000Z | ansible/my_env/lib/python2.7/site-packages/ansible/plugins/action/ce.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 5 | 2020-02-26T20:10:50.000Z | 2021-09-23T23:23:18.000Z | ansible/my_env/lib/python2.7/site-packages/ansible/plugins/action/ce.py | otus-devops-2019-02/yyashkin_infra | 0cd0c003884155ac922e3e301305ac202de7028c | [
"MIT"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | 47.017699 | 126 | 0.645022 |
7f6466f347b26528f5e3d25e718e8d9fbb4b5522 | 814 | py | Python | Chapter02/py212privateProperty.py | csy1993/PythonQt | c100cd9e1327fc7731bf04c7754cafb8dd578fa5 | [
"Apache-2.0"
] | null | null | null | Chapter02/py212privateProperty.py | csy1993/PythonQt | c100cd9e1327fc7731bf04c7754cafb8dd578fa5 | [
"Apache-2.0"
] | null | null | null | Chapter02/py212privateProperty.py | csy1993/PythonQt | c100cd9e1327fc7731bf04c7754cafb8dd578fa5 | [
"Apache-2.0"
] | null | null | null | '''
* @Author: csy
* @Date: 2019-05-09 15:42:03
* @Last Modified by: csy
* @Last Modified time: 2019-05-09 15:42:03
'''
# -*- coding: utf-8 -*-
class MyCounter:
__secretCount = 0 # 私有变量
publicCount = 0 # 公开变量
def __privateCountFun(self):
print('这是私有方法')
self.__secretCount += 1
... | 22.611111 | 58 | 0.626536 |
0865b12c4cc75efcbb60119c26590f7141bebd54 | 1,927 | py | Python | Others/cisco_crack.py | OblackatO/OffensiveSecurity | 4b2c5f981cf41cc463791f279c3ad0115c28d738 | [
"MIT"
] | 1 | 2018-05-09T05:51:35.000Z | 2018-05-09T05:51:35.000Z | Others/cisco_crack.py | pegom96/OffensiveSecurity | 4b2c5f981cf41cc463791f279c3ad0115c28d738 | [
"MIT"
] | null | null | null | Others/cisco_crack.py | pegom96/OffensiveSecurity | 4b2c5f981cf41cc463791f279c3ad0115c28d738 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
import time,re
global list_colors,list_animals,list_passwd
list_colors =... | 34.410714 | 103 | 0.731707 |
d1e79a95138de4c7b1b06065f2ecc9f6224967cd | 192 | py | Python | painter/tests/runner.py | adam-thomas/imperial-painter | 092c858c35dce5b2d598f1c3c5845d4838d13944 | [
"MIT"
] | null | null | null | painter/tests/runner.py | adam-thomas/imperial-painter | 092c858c35dce5b2d598f1c3c5845d4838d13944 | [
"MIT"
] | 22 | 2015-09-23T10:44:08.000Z | 2022-03-09T21:34:03.000Z | painter/tests/runner.py | adam-thomas/imperial-painter | 092c858c35dce5b2d598f1c3c5845d4838d13944 | [
"MIT"
] | null | null | null | from colour_runner.django_runner import ColourRunnerMixin
from django.test.runner import DiscoverRunner
class TestRunner(ColourRunnerMixin, DiscoverRunner):
"""I like pretty colours."""
| 27.428571 | 57 | 0.817708 |
9f8118f7b679c15ee81e603711275c1ae4cb7d80 | 2,407 | py | Python | metadata-ingestion/src/datahub/ingestion/api/sink.py | zhoxie-cisco/datahub | 254a73e6ca9b1ec6002fcf013ed42cb6a754d1ad | [
"Apache-2.0"
] | 3,586 | 2020-01-27T11:09:57.000Z | 2022-03-15T16:13:30.000Z | metadata-ingestion/src/datahub/ingestion/api/sink.py | zhoxie-cisco/datahub | 254a73e6ca9b1ec6002fcf013ed42cb6a754d1ad | [
"Apache-2.0"
] | 1,678 | 2020-01-27T20:51:01.000Z | 2022-03-15T15:22:02.000Z | metadata-ingestion/src/datahub/ingestion/api/sink.py | zhoxie-cisco/datahub | 254a73e6ca9b1ec6002fcf013ed42cb6a754d1ad | [
"Apache-2.0"
] | 924 | 2020-01-28T20:10:50.000Z | 2022-03-15T10:01:23.000Z | from abc import ABCMeta, abstractmethod
from dataclasses import dataclass, field
from typing import Any, List
from datahub.ingestion.api.closeable import Closeable
from datahub.ingestion.api.common import PipelineContext, RecordEnvelope, WorkUnit
from datahub.ingestion.api.report import Report
@dataclass
class SinkR... | 25.606383 | 85 | 0.680515 |
0abd949f6fd2cd0b42355f7274f56855ac9816be | 127 | py | Python | pysitra/__init__.py | marjanmo/pysitra | deaf2b84c8ccb72207a514a1adfc43d64b23b29d | [
"MIT"
] | 1 | 2017-11-29T22:37:46.000Z | 2017-11-29T22:37:46.000Z | pysitra/__init__.py | marjanmo/pysitra | deaf2b84c8ccb72207a514a1adfc43d64b23b29d | [
"MIT"
] | null | null | null | pysitra/__init__.py | marjanmo/pysitra | deaf2b84c8ccb72207a514a1adfc43d64b23b29d | [
"MIT"
] | null | null | null | from .trans import SloTransformation,trans_2R_4params,trans_2R_6params,trans_3R_7params,csv_transformation,shp_transformation
| 42.333333 | 125 | 0.913386 |
f31a0c9f4f02ed92439611e5844a932cb71b471b | 2,542 | py | Python | bank/cards/models.py | ruixy/bank | eb4e20f2dfae07ed41751f58288f0b7500935663 | [
"Apache-2.0"
] | null | null | null | bank/cards/models.py | ruixy/bank | eb4e20f2dfae07ed41751f58288f0b7500935663 | [
"Apache-2.0"
] | null | null | null | bank/cards/models.py | ruixy/bank | eb4e20f2dfae07ed41751f58288f0b7500935663 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
# django apps
from django.db import models
class CardStatus(models.Model):
''' 银行卡的状态 '''
name = models.CharField(max_length=16, verbose_name='名称')
remark = models.TextField(blank=True, verbose_name='备注')
def __str__(self):
return self.name
class CardOperateType(... | 25.42 | 75 | 0.585759 |
5eada3b78019b21c3769283316e88b6391d47b19 | 20,098 | py | Python | qiskit_nature/algorithms/pes_samplers/extrapolator.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | 1 | 2022-02-15T08:34:51.000Z | 2022-02-15T08:34:51.000Z | qiskit_nature/algorithms/pes_samplers/extrapolator.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | null | null | null | qiskit_nature/algorithms/pes_samplers/extrapolator.py | jschuhmac/qiskit-nature | b8b1181d951cf8fa76fe0db9e5ea192dad5fb186 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 41.870833 | 100 | 0.651657 |
b9287c19264f8eb0d52f2af07d433453731a65b8 | 720 | py | Python | idact/detail/log/get_logger.py | intdata-bsc/idact | 54cb65a711c145351e205970c27c83e6393cccf5 | [
"MIT"
] | 5 | 2018-12-06T15:40:34.000Z | 2019-06-19T11:22:58.000Z | idact/detail/log/get_logger.py | garstka/idact | b9c8405c94db362c4a51d6bfdf418b14f06f0da1 | [
"MIT"
] | 9 | 2018-12-06T16:35:26.000Z | 2019-04-28T19:01:40.000Z | idact/detail/log/get_logger.py | intdata-bsc/idact | 54cb65a711c145351e205970c27c83e6393cccf5 | [
"MIT"
] | 2 | 2019-04-28T19:18:58.000Z | 2019-06-17T06:56:28.000Z | """This module contains functions for getting a logger from a global provider.
"""
import logging
from idact.detail.log.logger_provider import LoggerProvider
def get_logger(name: str) -> logging.Logger:
"""Returns a logger with the proper logging level set.
See :class:`.LoggerProvider`.
:param... | 24.827586 | 78 | 0.691667 |
954fec0cc73f57b10e8f4be47ef469f3ce0e3355 | 58 | py | Python | source/documentModel/comparators/__init__.py | vilaras/PyINSECT | 4cc20659c47bd5f9c394d175cb041b729f6eb132 | [
"Apache-2.0"
] | 178 | 2016-09-21T19:51:28.000Z | 2021-09-07T17:37:06.000Z | source/documentModel/comparators/__init__.py | vilaras/PyINSECT | 4cc20659c47bd5f9c394d175cb041b729f6eb132 | [
"Apache-2.0"
] | 2 | 2021-05-27T19:47:25.000Z | 2021-05-28T17:11:23.000Z | source/documentModel/comparators/__init__.py | vilaras/PyINSECT | 4cc20659c47bd5f9c394d175cb041b729f6eb132 | [
"Apache-2.0"
] | 17 | 2016-10-21T02:11:13.000Z | 2020-10-07T19:11:54.000Z | from NGramGraphSimilarity import *
from Operator import *
| 19.333333 | 34 | 0.827586 |
7b7b6ed75f7330cdf32559780f7e4df7340e92c9 | 237 | py | Python | aws-boto3-demos/ec2/2_ec2_monitor_off.py | prafulpatel16/python-practice | 9a66f83e5d846c22c117faa4e0f1e8882de2193d | [
"Apache-2.0"
] | null | null | null | aws-boto3-demos/ec2/2_ec2_monitor_off.py | prafulpatel16/python-practice | 9a66f83e5d846c22c117faa4e0f1e8882de2193d | [
"Apache-2.0"
] | null | null | null | aws-boto3-demos/ec2/2_ec2_monitor_off.py | prafulpatel16/python-practice | 9a66f83e5d846c22c117faa4e0f1e8882de2193d | [
"Apache-2.0"
] | null | null | null | import sys
import boto3
ec2 = boto3.client('ec2')
if sys.argv[1] == 'ON':
response = ec2.monitor_instance(InstaceIds=['INSTANCE_ID'])
else:
response = ec2.monitor_instance(InstaceIds=['INSTANCE_ID'])
print (response)
| 21.545455 | 64 | 0.683544 |
bb60d549d217d51d21987bb3d61f405e47ec394b | 1,099 | py | Python | day_11/day11_test.py | mickeelm/aoc2019 | 7fd532d2237e1cf0686c9b331a2b97515ee94c03 | [
"Unlicense"
] | 1 | 2021-02-02T08:32:36.000Z | 2021-02-02T08:32:36.000Z | day_11/day11_test.py | mickeelm/aoc2019 | 7fd532d2237e1cf0686c9b331a2b97515ee94c03 | [
"Unlicense"
] | null | null | null | day_11/day11_test.py | mickeelm/aoc2019 | 7fd532d2237e1cf0686c9b331a2b97515ee94c03 | [
"Unlicense"
] | null | null | null | from day_11.day11 import Panel, next_panel, Direction, rotate, count_painted_panels, print_panels
def test_next_panel():
assert next_panel(Panel(0, 0), Direction.UP) == (0, 1)
assert next_panel(Panel(0, 0), Direction.RIGHT) == (1, 0)
assert next_panel(Panel(0, 0), Direction.DOWN) == (0, -1)
assert nex... | 36.633333 | 97 | 0.678799 |
a221ca36be25977300b21b6f9de2b6f4b00897dc | 1,124 | py | Python | src/shijing.py | hippieZhou/chinese-poetry-db | 8a1b111a1bdfc9b08a5447975c1fe01076e75d8c | [
"MIT"
] | 28 | 2019-07-18T09:47:05.000Z | 2022-03-31T05:26:19.000Z | src/shijing.py | hippieZhou/chinese-poetry-db | 8a1b111a1bdfc9b08a5447975c1fe01076e75d8c | [
"MIT"
] | 1 | 2019-05-03T02:54:21.000Z | 2019-05-03T02:54:21.000Z | src/shijing.py | hippieZhou/chinese-poetry-db | 8a1b111a1bdfc9b08a5447975c1fe01076e75d8c | [
"MIT"
] | 4 | 2019-07-25T04:44:10.000Z | 2021-06-20T11:28:25.000Z | """
类别:诗经
"""
import sqlite3
import os
import json
def make_db(db, path):
sql = '''
CREATE TABLE IF NOT EXISTS "shijing" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"title" text,
"chapter" text,
"section" TEXT,
"content" TEXT
);
'''
print('\r\n诗经 正在初始化...')
try:
conn = sqlite3.con... | 26.139535 | 107 | 0.549822 |
f46c45b91e59e9781844981c3d0e7ad02019679c | 35,435 | py | Python | lifetimes/plotting.py | DaniGate/lifetimes | 514d69fbc1cb721f560489d917e37a2736508109 | [
"MIT"
] | null | null | null | lifetimes/plotting.py | DaniGate/lifetimes | 514d69fbc1cb721f560489d917e37a2736508109 | [
"MIT"
] | null | null | null | lifetimes/plotting.py | DaniGate/lifetimes | 514d69fbc1cb721f560489d917e37a2736508109 | [
"MIT"
] | 1 | 2018-04-16T14:27:31.000Z | 2018-04-16T14:27:31.000Z | import sys
import os
import numpy as np
import pandas as pd
import datetime as dt
from scipy import stats
from lifetimes.utils import calculate_alive_path, expected_cumulative_transactions
PROJECTSPATH = os.environ['PROJECTSPATH']
sys.path.insert(0, os.path.join(PROJECTSPATH,'ops-scripts'))
from common.settings impor... | 35.15377 | 193 | 0.584366 |
39ccef52633c9a1ecf36491a4baa0431b35496bf | 24,427 | py | Python | src/containerapp/azext_containerapp/_utils.py | zoharHenMicrosoft/azure-cli-extensions | 4b9b8d19d029f2f736c54b263e8a9f7894499dc3 | [
"MIT"
] | 1 | 2022-01-25T07:33:18.000Z | 2022-01-25T07:33:18.000Z | src/containerapp/azext_containerapp/_utils.py | zoharHenMicrosoft/azure-cli-extensions | 4b9b8d19d029f2f736c54b263e8a9f7894499dc3 | [
"MIT"
] | null | null | null | src/containerapp/azext_containerapp/_utils.py | zoharHenMicrosoft/azure-cli-extensions | 4b9b8d19d029f2f736c54b263e8a9f7894499dc3 | [
"MIT"
] | 1 | 2022-03-10T22:13:02.000Z | 2022-03-10T22:13:02.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 41.542517 | 211 | 0.661113 |
64f00a575c42ebccef6be7ddfd0b9177177099fd | 45 | py | Python | instantmailer/__init__.py | Pythonastics/pymail | a7659cdff09ac3a77bc1c06638a00352168e006c | [
"MIT"
] | null | null | null | instantmailer/__init__.py | Pythonastics/pymail | a7659cdff09ac3a77bc1c06638a00352168e006c | [
"MIT"
] | null | null | null | instantmailer/__init__.py | Pythonastics/pymail | a7659cdff09ac3a77bc1c06638a00352168e006c | [
"MIT"
] | null | null | null | from .mail import Mail
__version__ = "1.0.0" | 15 | 22 | 0.711111 |
5e8d1f671a412b9cc300c1d4d1ef7c7b6cad37f1 | 376 | py | Python | setup.py | eranroz/BotMisparim | 4553cc7679e7c04ddf3eb7920e0cd5166cb57087 | [
"MIT"
] | 1 | 2021-11-02T10:09:01.000Z | 2021-11-02T10:09:01.000Z | setup.py | eranroz/BotMisparim | 4553cc7679e7c04ddf3eb7920e0cd5166cb57087 | [
"MIT"
] | null | null | null | setup.py | eranroz/BotMisparim | 4553cc7679e7c04ddf3eb7920e0cd5166cb57087 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name='botMisparim',
version='1.0',
packages=[''],
scripts=['misparim.py'],
url='https://github.com/eranroz/BotMisparim',
license='MIT',
author='eranroz',
author_email='eranroz@cs.huji.ac.il',
description='Bot for scanning common grammar mistak... | 25.066667 | 69 | 0.659574 |
f14038c3af25510ac2db7cc0b2d4866fb27f4657 | 391 | py | Python | homebar/homebar/asgi.py | cdriehuys/home-bar | 22e408c00f3bae0b9b7c0de6ebba36e211c32828 | [
"MIT"
] | null | null | null | homebar/homebar/asgi.py | cdriehuys/home-bar | 22e408c00f3bae0b9b7c0de6ebba36e211c32828 | [
"MIT"
] | null | null | null | homebar/homebar/asgi.py | cdriehuys/home-bar | 22e408c00f3bae0b9b7c0de6ebba36e211c32828 | [
"MIT"
] | null | null | null | """
ASGI config for homebar project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
d244e7d77fc3187f3712ffc2e750f00a0b556877 | 663 | py | Python | setup.py | pratik-m/OracleERPIntegrationServiceWrapper | dd3af6d92c9665c662163179f35b9b6e06638a5b | [
"MIT"
] | null | null | null | setup.py | pratik-m/OracleERPIntegrationServiceWrapper | dd3af6d92c9665c662163179f35b9b6e06638a5b | [
"MIT"
] | null | null | null | setup.py | pratik-m/OracleERPIntegrationServiceWrapper | dd3af6d92c9665c662163179f35b9b6e06638a5b | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name="OracleSaaSApiPy",
version="1.0.0.2",
author="Pratik Munot",
description="An API wrapper for Oracle SaaS Webservice APIs",
long_description="An API wrapper for Oracle SaaS Webservice APIs",
url="https://github.com/pratik-m/OracleERPIntegrationS... | 31.571429 | 74 | 0.651584 |
7f701bc357ddbeaa907d1226ef42aea535a70943 | 300 | py | Python | CreeDictionary/tests/utils_tests/test_profiling.py | aaronfay/cree-intelligent-dictionary | 5119aa819a48d0ce21c002af284bd2a28a77b15b | [
"Apache-2.0"
] | null | null | null | CreeDictionary/tests/utils_tests/test_profiling.py | aaronfay/cree-intelligent-dictionary | 5119aa819a48d0ce21c002af284bd2a28a77b15b | [
"Apache-2.0"
] | null | null | null | CreeDictionary/tests/utils_tests/test_profiling.py | aaronfay/cree-intelligent-dictionary | 5119aa819a48d0ce21c002af284bd2a28a77b15b | [
"Apache-2.0"
] | null | null | null | import time
from utils.profiling import timed
def test_timed_decorator(capsys):
@timed(msg="{func_name} finished in {second:.1f} seconds")
def quick_nap():
time.sleep(0.1)
quick_nap()
out, err = capsys.readouterr()
assert "quick_nap finished in 0.1 seconds\n" == out
| 20 | 62 | 0.673333 |
c975a464a180f698babd3c2866f9886e1512f8c7 | 39,710 | py | Python | Bio/Phylo/TreeConstruction.py | amblina/biopython | 5045a7a3e86d5b32e0eaab941ab35daac86c59f8 | [
"PostgreSQL"
] | 1 | 2018-12-27T08:43:52.000Z | 2018-12-27T08:43:52.000Z | Bio/Phylo/TreeConstruction.py | amblina/biopython | 5045a7a3e86d5b32e0eaab941ab35daac86c59f8 | [
"PostgreSQL"
] | null | null | null | Bio/Phylo/TreeConstruction.py | amblina/biopython | 5045a7a3e86d5b32e0eaab941ab35daac86c59f8 | [
"PostgreSQL"
] | 1 | 2018-12-27T08:43:42.000Z | 2018-12-27T08:43:42.000Z | # Copyright (C) 2013 by Yanbo Ye (yeyanbo289@gmail.com)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Classes and methods for tree construction"""
import itertools
import copy
from Bio.Phylo imp... | 37.356538 | 126 | 0.531629 |
b776deb37789da6405558e8c16dce2bd6c24b574 | 1,803 | py | Python | septentrion/lib.py | peopledoc/septentrion | 7c91890f525878ed50ccb8be482d093b93ef77f2 | [
"MIT"
] | 7 | 2020-02-11T15:24:09.000Z | 2021-12-08T12:24:59.000Z | septentrion/lib.py | peopledoc/septentrion | 7c91890f525878ed50ccb8be482d093b93ef77f2 | [
"MIT"
] | 124 | 2018-12-06T14:42:13.000Z | 2022-03-14T21:37:09.000Z | septentrion/lib.py | peopledoc/septentrion | 7c91890f525878ed50ccb8be482d093b93ef77f2 | [
"MIT"
] | 1 | 2020-02-11T15:24:14.000Z | 2020-02-11T15:24:14.000Z | import logging
from typing import Iterable
from septentrion import core, db, files, migration, style, versions
logger = logging.getLogger(__name__)
def initialize(settings_kwargs):
quiet = settings_kwargs.pop("quiet", False)
stylist = style.noop_stylist if quiet else style.stylist
settings = core.initi... | 32.196429 | 82 | 0.77371 |
95244e95d6ba3b806abed4478cf34bbe039320a9 | 1,153 | py | Python | compute/api/create_instance_test.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 4 | 2018-12-23T18:17:14.000Z | 2020-01-05T19:13:58.000Z | compute/api/create_instance_test.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 16 | 2019-06-15T00:02:56.000Z | 2021-03-25T23:22:38.000Z | compute/api/create_instance_test.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 4 | 2018-06-03T14:43:25.000Z | 2019-11-24T04:05:18.000Z | # Copyright 2015, 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 or agreed to in writing, s... | 27.452381 | 75 | 0.702515 |
e8675f0ad03972825dcf990efa9bc8bddd65047f | 4,102 | py | Python | src/olympe/utils/format.py | bkbilly/olympe | 77cdb634d4221a6311369ddf3b68b7eb46b2b741 | [
"BSD-3-Clause"
] | null | null | null | src/olympe/utils/format.py | bkbilly/olympe | 77cdb634d4221a6311369ddf3b68b7eb46b2b741 | [
"BSD-3-Clause"
] | null | null | null | src/olympe/utils/format.py | bkbilly/olympe | 77cdb634d4221a6311369ddf3b68b7eb46b2b741 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2019-2021 Parrot Drones SAS
#
# 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 followin... | 36.954955 | 80 | 0.670161 |
d301d588d6b3ccbe6d394594bc26913888a21e6f | 156 | py | Python | ai/corrections/ml_d01/ex05.py | PoCFrance/security-pool-2018 | acabc082808ade8ceccc395736a337059c0650de | [
"MIT"
] | 8 | 2018-02-27T09:31:04.000Z | 2019-05-09T14:42:51.000Z | ai/corrections/ml_d01/ex05.py | PoCFrance/security-pool-2018 | acabc082808ade8ceccc395736a337059c0650de | [
"MIT"
] | null | null | null | ai/corrections/ml_d01/ex05.py | PoCFrance/security-pool-2018 | acabc082808ade8ceccc395736a337059c0650de | [
"MIT"
] | 2 | 2018-02-27T09:31:05.000Z | 2018-07-27T14:07:53.000Z | import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-10, 10, 30)
y = 1 / (1 + np.exp(-x))
z = y
plt.xlim(-10, 10)
plt.plot(x, y)
plt.show()
| 15.6 | 31 | 0.621795 |
8595f22701c3ef1b2feb3c211d27012b2d943501 | 13,370 | py | Python | config/settings/base.py | leonardoo/cb_backend | 3b92c12856961539fee55ac6c05adbfec4ee5784 | [
"MIT"
] | null | null | null | config/settings/base.py | leonardoo/cb_backend | 3b92c12856961539fee55ac6c05adbfec4ee5784 | [
"MIT"
] | null | null | null | config/settings/base.py | leonardoo/cb_backend | 3b92c12856961539fee55ac6c05adbfec4ee5784 | [
"MIT"
] | null | null | null | """
Base settings to build other settings files upon.
"""
from pathlib import Path
import environ
ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
# cb_backend/
APPS_DIR = ROOT_DIR / "cb_backend"
env = environ.Env()
READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=False)
if READ_DO... | 42.444444 | 100 | 0.651085 |
ba1409c730c2bf926e4d8a2554b69400ba75caad | 3,815 | py | Python | segment.py | hakril/midap | 726c62b583192b8ebb4d217bd5d13b318df0bc0f | [
"BSD-3-Clause"
] | 1 | 2017-08-25T12:23:10.000Z | 2017-08-25T12:23:10.000Z | segment.py | hakril/midap | 726c62b583192b8ebb4d217bd5d13b318df0bc0f | [
"BSD-3-Clause"
] | null | null | null | segment.py | hakril/midap | 726c62b583192b8ebb4d217bd5d13b318df0bc0f | [
"BSD-3-Clause"
] | null | null | null | import elt
import idc
import idaapi
class IDASegment(elt.IDANamedSizedElt):
# Segment from any addr ? : yep
def __init__(self, addr):
start = idc.SegStart(addr)
end = idc.SegEnd(addr)
# TODO: when implementing segment relocation: be carrefull with self.addr going out of the new segment... | 33.173913 | 110 | 0.613893 |
ef0cfce2c5c2cc0028302538686c3c744d63853e | 749 | py | Python | soni_f110_ws/build/f110-skeletons-spring2020/simulator/racecar_simulator/catkin_generated/pkg.develspace.context.pc.py | 4-legends/Paresh-Soni-F110-2020 | 24b8d6ee654d4b0f78dc2bf643f0f850e5c0ca85 | [
"MIT"
] | null | null | null | soni_f110_ws/build/f110-skeletons-spring2020/simulator/racecar_simulator/catkin_generated/pkg.develspace.context.pc.py | 4-legends/Paresh-Soni-F110-2020 | 24b8d6ee654d4b0f78dc2bf643f0f850e5c0ca85 | [
"MIT"
] | null | null | null | soni_f110_ws/build/f110-skeletons-spring2020/simulator/racecar_simulator/catkin_generated/pkg.develspace.context.pc.py | 4-legends/Paresh-Soni-F110-2020 | 24b8d6ee654d4b0f78dc2bf643f0f850e5c0ca85 | [
"MIT"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/graspinglab/carla-ros-bridge/Paresh-Soni-F110-2020/soni_f110_ws/src/f110-skeletons-spring2020/simulator/racecar_simulator/include".split(';') if "/home/graspinglab/carla-ros-bridge/Paresh-Soni-F1... | 83.222222 | 337 | 0.795728 |
21a04012fc37b26cc06fefeb33d9bb0d1706fc07 | 571 | py | Python | pypy/module/__pypy__/bytebuffer.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 1 | 2019-05-27T00:58:46.000Z | 2019-05-27T00:58:46.000Z | pypy/module/__pypy__/bytebuffer.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/module/__pypy__/bytebuffer.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | #
# A convenient read-write buffer. Located here for want of a better place.
#
from pypy.interpreter.buffer import RWBuffer
from pypy.interpreter.gateway import ObjSpace
class ByteBuffer(RWBuffer):
def __init__(self, len):
self.data = ['\x00'] * len
def getlength(self):
return len(self.dat... | 21.148148 | 75 | 0.683012 |
39f24a6307619d5874e1acf788d4e6b6d05b2e00 | 30,356 | py | Python | frappe/utils/data.py | jch4nni/frappe | 64387632ff64ff0c3e2fa5e793d1e7b3b6e2c27e | [
"MIT"
] | null | null | null | frappe/utils/data.py | jch4nni/frappe | 64387632ff64ff0c3e2fa5e793d1e7b3b6e2c27e | [
"MIT"
] | 4 | 2019-11-10T20:43:56.000Z | 2021-04-22T13:52:53.000Z | frappe/utils/data.py | jch4nni/frappe | 64387632ff64ff0c3e2fa5e793d1e7b3b6e2c27e | [
"MIT"
] | 1 | 2021-03-10T10:58:28.000Z | 2021-03-10T10:58:28.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
# IMPORTANT: only import safe functions as this module will be included in jinja environment
import frappe
import subprocess
import operator
import re, datetime, math, time
impor... | 28.800759 | 152 | 0.696403 |
a6d60b6565129b8838a86e98b5a368f656a6a31b | 1,292 | py | Python | test/functional/p2p_mempool.py | cryptomiles/cryptomiles | d3815eaf7716fbca9459f4162ae7ba4714298d27 | [
"MIT"
] | null | null | null | test/functional/p2p_mempool.py | cryptomiles/cryptomiles | d3815eaf7716fbca9459f4162ae7ba4714298d27 | [
"MIT"
] | null | null | null | test/functional/p2p_mempool.py | cryptomiles/cryptomiles | d3815eaf7716fbca9459f4162ae7ba4714298d27 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Cryptomiles Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test p2p mempool message.
Test that nodes are dis... | 33.128205 | 75 | 0.712074 |
a84e7e02c60daff2c50bf1eb09781365997c1468 | 13,181 | py | Python | tf_agents/experimental/examples/ppo/train_eval_lib.py | ngroves08/agents | cdb7a94124a1bc756217ad868b1aa49c11dc26bf | [
"Apache-2.0"
] | 1 | 2021-04-19T02:28:24.000Z | 2021-04-19T02:28:24.000Z | tf_agents/experimental/examples/ppo/train_eval_lib.py | ngroves08/agents | cdb7a94124a1bc756217ad868b1aa49c11dc26bf | [
"Apache-2.0"
] | null | null | null | tf_agents/experimental/examples/ppo/train_eval_lib.py | ngroves08/agents | cdb7a94124a1bc756217ad868b1aa49c11dc26bf | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 40.682099 | 80 | 0.741749 |
e365cd41f656a991643fae46e5405642557b8adb | 13,070 | py | Python | django/utils/html.py | szuprefix/django | 4803834aaad99a92e65b5c70ccdbcf4d07ea9b03 | [
"PSF-2.0",
"BSD-3-Clause"
] | 4 | 2020-04-08T17:57:46.000Z | 2021-11-08T08:56:16.000Z | django/utils/html.py | guilhermej/django | 1d8cfa36089f2d1295abad03a99fc3c259bde6b5 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/utils/html.py | guilhermej/django | 1d8cfa36089f2d1295abad03a99fc3c259bde6b5 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | """HTML utilities suitable for global use."""
import re
from html.parser import HTMLParser
from urllib.parse import (
parse_qsl, quote, unquote, urlencode, urlsplit, urlunsplit,
)
from django.utils.encoding import force_text
from django.utils.functional import Promise, keep_lazy, keep_lazy_text
from django.utils.... | 35.710383 | 110 | 0.599923 |
72e8553a951ffa8b378dab8a952903a9801d6e4d | 11,242 | py | Python | tf_agents/environments/time_step.py | YoussefBenDhieb/agents | 7ff8119dbb10f2a250e458e82f78b1818951f535 | [
"Apache-2.0"
] | 1 | 2019-10-28T08:39:04.000Z | 2019-10-28T08:39:04.000Z | tf_agents/environments/time_step.py | Akshay22121995/agents | 1455410dffed3cfdede793b87c179965cdd27d22 | [
"Apache-2.0"
] | null | null | null | tf_agents/environments/time_step.py | Akshay22121995/agents | 1455410dffed3cfdede793b87c179965cdd27d22 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The TF-Agents 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... | 36.859016 | 80 | 0.701832 |
bc1b118bde727d06efb225ba46e4a9cf34703e68 | 593 | py | Python | main.py | Raffson/Heroku-Example | 6084f39948e5885005a3174153ca6dc912a1a354 | [
"MIT"
] | null | null | null | main.py | Raffson/Heroku-Example | 6084f39948e5885005a3174153ca6dc912a1a354 | [
"MIT"
] | null | null | null | main.py | Raffson/Heroku-Example | 6084f39948e5885005a3174153ca6dc912a1a354 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
import datetime as dt
app = Flask(__name__)
@app.route("/")
def index():
some_text = "Message from the index-handler."
current_year = dt.datetime.now().year
cities = ["Boston", "Vienna", "Paris", "Berlin"]
return render_template("index.html", some_text_name=so... | 22.807692 | 66 | 0.667791 |
2a8f065d9168dd387fb6454d3db39f4c002727b1 | 21,936 | py | Python | src/torch/nn/parallel/distributed.py | warcraft12321/Hyperfoods | b995cd7afe10fcbd338158c80f53ce637bfffc0c | [
"MIT"
] | 51 | 2020-01-26T23:32:57.000Z | 2022-03-20T14:49:57.000Z | src/torch/nn/parallel/distributed.py | warcraft12321/Hyperfoods | b995cd7afe10fcbd338158c80f53ce637bfffc0c | [
"MIT"
] | 2 | 2020-12-19T20:00:28.000Z | 2021-03-03T20:22:45.000Z | src/torch/nn/parallel/distributed.py | warcraft12321/Hyperfoods | b995cd7afe10fcbd338158c80f53ce637bfffc0c | [
"MIT"
] | 33 | 2020-02-18T16:15:48.000Z | 2022-03-24T15:12:05.000Z | import sys
import math
import threading
import copy
import torch
from torch.autograd import Variable
from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors, \
_take_tensors
from torch.cuda.comm import broadcast_coalesced
from torch.cuda import nccl
import torch.distributed as dist
from ..modul... | 45.416149 | 117 | 0.627006 |
aa0d945385b47dc6d41e6b72f9e979a57cb126cb | 2,227 | py | Python | galaxy_milkyway_files/tools/wohl-proteomics/msgf2pin/mass.py | wohllab/milkyway_proteomics | 622969f7f4a5955ae2bff299ae7b08572d422814 | [
"MIT"
] | null | null | null | galaxy_milkyway_files/tools/wohl-proteomics/msgf2pin/mass.py | wohllab/milkyway_proteomics | 622969f7f4a5955ae2bff299ae7b08572d422814 | [
"MIT"
] | null | null | null | galaxy_milkyway_files/tools/wohl-proteomics/msgf2pin/mass.py | wohllab/milkyway_proteomics | 622969f7f4a5955ae2bff299ae7b08572d422814 | [
"MIT"
] | null | null | null | import re
from orangecontrib.bio.ontology import OBOParser
import orangecontrib
from pyteomics import mass
import sys
mod_bracket_re='\[|\]'
mod_dict={}
pepseq="VS[UNIMOD:21]KLKNWEY[UNIMOD:21]R"
mod_obo="/galaxy-central/tools/wohl-proteomics/MSGFcrux/unimod.obo"
with open(mod_obo,"r") as unimod_obo:
obo_parser=ora... | 37.116667 | 114 | 0.515492 |
bad65b4f8be9808a1fe00e86655ca2cfe8898d04 | 200 | py | Python | google_play_scraper/__init__.py | kluhan/google-play-scraper | 478d7461a5c3c4557949585647f75ac9682e9eee | [
"MIT"
] | null | null | null | google_play_scraper/__init__.py | kluhan/google-play-scraper | 478d7461a5c3c4557949585647f75ac9682e9eee | [
"MIT"
] | null | null | null | google_play_scraper/__init__.py | kluhan/google-play-scraper | 478d7461a5c3c4557949585647f75ac9682e9eee | [
"MIT"
] | null | null | null | from .constants.google_play import Sort
from .features.app import app
from .features.reviews import reviews, reviews_all
from .features.permissions import permissions
VERSION = __version__ = "0.2.1"
| 28.571429 | 50 | 0.81 |
9130c1e3b84bca8e13150bae8dbd14a2637101e0 | 3,428 | py | Python | application/test_app.py | martibook/SemanPhone | fbd895f61000f0d5e3ce9f5d3d6b7c2078620281 | [
"MIT"
] | null | null | null | application/test_app.py | martibook/SemanPhone | fbd895f61000f0d5e3ce9f5d3d6b7c2078620281 | [
"MIT"
] | 2 | 2018-03-22T21:38:44.000Z | 2018-04-19T20:57:15.000Z | application/test_app.py | martibook/SemanPhone | fbd895f61000f0d5e3ce9f5d3d6b7c2078620281 | [
"MIT"
] | 1 | 2018-04-19T10:41:03.000Z | 2018-04-19T10:41:03.000Z | from flask import Flask, render_template, redirect, url_for, request, session
from flask_bootstrap import Bootstrap
from application.tools.exceptions import NoResults
from application.tools.database import get_asso_words, get_definitions, pick_words_4experiment, pick_words_4control, \
get_quiz_info, increase_corra... | 27.424 | 124 | 0.712952 |
6ea10d4c8ec0abf73fb1a6ce08dc319076a7ffad | 362 | py | Python | avatar/urls.py | sterliakov/django-avatar | e8be928d4f7bd442822f1dcc576f6c0909360475 | [
"BSD-3-Clause"
] | null | null | null | avatar/urls.py | sterliakov/django-avatar | e8be928d4f7bd442822f1dcc576f6c0909360475 | [
"BSD-3-Clause"
] | null | null | null | avatar/urls.py | sterliakov/django-avatar | e8be928d4f7bd442822f1dcc576f6c0909360475 | [
"BSD-3-Clause"
] | null | null | null | from django.urls import path
from avatar import views
urlpatterns = [
path(r'add/', views.add, name='avatar_add'),
path(r'change/', views.change, name='avatar_change'),
path(r'delete/', views.delete, name='avatar_delete'),
path(r'render_primary/<slug:user>/<int:size>/',
views.render_primary,
... | 27.846154 | 57 | 0.668508 |
af6c0f9dbe2c19a699d569c8f4693ecebe07dd63 | 257 | py | Python | Projects/Languages/Python/Labs/Unit 00/Inputs/Input.py | mikozera/Computer-Science | 52d2a317d95e2df2a82f54e837e43b6e6873a400 | [
"MIT"
] | null | null | null | Projects/Languages/Python/Labs/Unit 00/Inputs/Input.py | mikozera/Computer-Science | 52d2a317d95e2df2a82f54e837e43b6e6873a400 | [
"MIT"
] | 3 | 2020-05-01T01:36:59.000Z | 2020-05-05T05:38:33.000Z | Projects/Languages/Python/Labs/Unit 00/Inputs/Input.py | mikozera/Computer-Science | 52d2a317d95e2df2a82f54e837e43b6e6873a400 | [
"MIT"
] | 1 | 2019-11-26T09:02:51.000Z | 2019-11-26T09:02:51.000Z | # intergers
interger = int(input("Enter a Interger :: "))
# floats
decimal = float(input("Enter a Float :: "))
# strings
input("Enter a String :: ")
# Print
print("\nInterger: " + str(interger) + "\nFloat: " +
str(decimal) + "\nString: " + string)
| 19.769231 | 52 | 0.607004 |
1162542f8e60ff57716f8d458d62249972395197 | 2,381 | py | Python | setup.py | yuokada/csv2athena_schema | ef583bd109c8de1b8b7e849f5afb0a34291c91b2 | [
"MIT"
] | null | null | null | setup.py | yuokada/csv2athena_schema | ef583bd109c8de1b8b7e849f5afb0a34291c91b2 | [
"MIT"
] | null | null | null | setup.py | yuokada/csv2athena_schema | ef583bd109c8de1b8b7e849f5afb0a34291c91b2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
REQUIRES = [
'docopt',
]
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = Tr... | 28.686747 | 79 | 0.612768 |
e2688489d68036e9499e7489f9c6e8d2f8f22b46 | 178 | py | Python | Python-Std-Libraries/click/click_commit.py | MiracleWong/PythonPractice | 40aecd84045ad18f6aff95d5b8be8e352ca0a726 | [
"MIT"
] | null | null | null | Python-Std-Libraries/click/click_commit.py | MiracleWong/PythonPractice | 40aecd84045ad18f6aff95d5b8be8e352ca0a726 | [
"MIT"
] | null | null | null | Python-Std-Libraries/click/click_commit.py | MiracleWong/PythonPractice | 40aecd84045ad18f6aff95d5b8be8e352ca0a726 | [
"MIT"
] | null | null | null | import click
@click.command()
@click.option('--message', '-m', multiple=True)
def commit(message):
click.echo('\n'.join(message))
if __name__ == '__main__':
commit()
| 14.833333 | 47 | 0.646067 |
cbcd2c6fc84d502ca29c6ee8cf00c7ac92f511a4 | 791 | py | Python | more_threads/channel.py | zehemz/clases-python-101 | 633cb5f0cbc85e64e242514f0394754a5bed0513 | [
"Apache-2.0"
] | null | null | null | more_threads/channel.py | zehemz/clases-python-101 | 633cb5f0cbc85e64e242514f0394754a5bed0513 | [
"Apache-2.0"
] | null | null | null | more_threads/channel.py | zehemz/clases-python-101 | 633cb5f0cbc85e64e242514f0394754a5bed0513 | [
"Apache-2.0"
] | null | null | null | # channel.py
#
# A minimal object that implements a message channel over a pair
# of file descriptors (like a pipe)
import cPickle as pickle
class Channel(object):
def __init__(self,out_f,in_f):
self.out_f = out_f
self.in_f = in_f
def send(self,item):
pickle.dump(item,self.out_f)
... | 23.969697 | 64 | 0.605563 |
530455636bdd1a62b4194b06685d4852e6aea132 | 12,794 | py | Python | library/azure_rm_trafficmanagerprofile_facts.py | wray/azure_modules | af2d84ffc4a0061f5ab4ed7e621faa0bbdbb2da5 | [
"MIT"
] | null | null | null | library/azure_rm_trafficmanagerprofile_facts.py | wray/azure_modules | af2d84ffc4a0061f5ab4ed7e621faa0bbdbb2da5 | [
"MIT"
] | null | null | null | library/azure_rm_trafficmanagerprofile_facts.py | wray/azure_modules | af2d84ffc4a0061f5ab4ed7e621faa0bbdbb2da5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright (c) 2018 Hai Cao, <t-haicao@microsoft.com>, Yunge Zhu <yungez@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metada... | 33.757256 | 159 | 0.560419 |
389b43d9f61c25cb1bc9a46d29298eecb6051544 | 2,257 | py | Python | jinahub/encoders/image/ImageTorchEncoder/tests/integration/test_flow_integration.py | Gikiman/executors | 98658b4136859164390cfccbde8cf0f7cf843593 | [
"Apache-2.0"
] | null | null | null | jinahub/encoders/image/ImageTorchEncoder/tests/integration/test_flow_integration.py | Gikiman/executors | 98658b4136859164390cfccbde8cf0f7cf843593 | [
"Apache-2.0"
] | null | null | null | jinahub/encoders/image/ImageTorchEncoder/tests/integration/test_flow_integration.py | Gikiman/executors | 98658b4136859164390cfccbde8cf0f7cf843593 | [
"Apache-2.0"
] | null | null | null | __copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
from typing import List
import numpy as np
import pytest
from jina import Flow, Document, DocumentArray
from ...torch_encoder import ImageTorchEncoder
@pytest.mark.parametrize('arr_in', [
(np.ones((224, 224, ... | 30.5 | 113 | 0.618077 |
23caa65f25b9b2815e2d5248244a713e5b9c9ef7 | 4,983 | py | Python | students/K33422/practical_works/Novatorova_Irina/django_project_novatorova/project_first_app/migrations/0002_auto_20210122_1935.py | reeeena/ITMO_ICT_WebDevelopment_2020-2021 | 9f6d3cdf48effd8976958c676ef99e323031d57c | [
"MIT"
] | null | null | null | students/K33422/practical_works/Novatorova_Irina/django_project_novatorova/project_first_app/migrations/0002_auto_20210122_1935.py | reeeena/ITMO_ICT_WebDevelopment_2020-2021 | 9f6d3cdf48effd8976958c676ef99e323031d57c | [
"MIT"
] | null | null | null | students/K33422/practical_works/Novatorova_Irina/django_project_novatorova/project_first_app/migrations/0002_auto_20210122_1935.py | reeeena/ITMO_ICT_WebDevelopment_2020-2021 | 9f6d3cdf48effd8976958c676ef99e323031d57c | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2021-01-22 19:35
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0012_alter_user... | 41.181818 | 328 | 0.608268 |
eaeec606236e8bb412417b9872108d402145373c | 5,215 | py | Python | samples/transpose/transpose_opentuner.py | abhisekkundu-intel/libxsmm | 66d97cb86c192ca727afd9ddf42ad8c80addf6e1 | [
"BSD-3-Clause"
] | 1 | 2021-05-23T21:25:05.000Z | 2021-05-23T21:25:05.000Z | samples/transpose/transpose_opentuner.py | abhisekkundu-intel/libxsmm | 66d97cb86c192ca727afd9ddf42ad8c80addf6e1 | [
"BSD-3-Clause"
] | null | null | null | samples/transpose/transpose_opentuner.py | abhisekkundu-intel/libxsmm | 66d97cb86c192ca727afd9ddf42ad8c80addf6e1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# Copyright (c) Intel Corporation - All rights reserved. #
# This file is part of the LIBXSMM library. #
# ... | 40.426357 | 79 | 0.540556 |
f7fe4fbbf04ddc7f858ba1868ed2188887e30a06 | 316 | py | Python | __main__.py | HsOjo/QiniuSyncer | 92e21179cd97ef1b5baf294d04dbfb7ce3db7aa9 | [
"MIT"
] | null | null | null | __main__.py | HsOjo/QiniuSyncer | 92e21179cd97ef1b5baf294d04dbfb7ce3db7aa9 | [
"MIT"
] | null | null | null | __main__.py | HsOjo/QiniuSyncer | 92e21179cd97ef1b5baf294d04dbfb7ce3db7aa9 | [
"MIT"
] | null | null | null | import sys
from app import Application
from app.util import pyinstaller
from app.util.log import Log
if getattr(sys, 'frozen', False):
# is run at pyinstaller
pyinstaller.fix_encoding_in_pyinstaller()
Log.init_app()
app = Application(sys.argv)
try:
app.run()
except:
app.callback_exception()
| 17.555556 | 45 | 0.731013 |
06d770d24fe8467ecea6b1df6f01ed227bed81b5 | 24,355 | py | Python | packages/dcos-integration-test/extra/test_mesos.py | timgates42/dcos | 9d7e4d65b797d67fcd32c626f8026f28d2dece90 | [
"Apache-2.0"
] | 2,577 | 2016-04-19T09:57:39.000Z | 2022-03-17T10:34:25.000Z | packages/dcos-integration-test/extra/test_mesos.py | timgates42/dcos | 9d7e4d65b797d67fcd32c626f8026f28d2dece90 | [
"Apache-2.0"
] | 7,410 | 2016-04-19T21:19:31.000Z | 2022-01-21T20:14:21.000Z | packages/dcos-integration-test/extra/test_mesos.py | timgates42/dcos | 9d7e4d65b797d67fcd32c626f8026f28d2dece90 | [
"Apache-2.0"
] | 625 | 2016-04-19T10:09:35.000Z | 2022-03-16T10:53:45.000Z | import copy
import json
import logging
import os
import textwrap
import uuid
from typing import Any, Generator
import pytest
import retrying
import test_helpers
from dcos_test_utils import marathon, recordio
from dcos_test_utils.dcos_api import DcosApiSession
__maintainer__ = 'Gilbert88'
__contact__ = 'core-team@me... | 43.882883 | 114 | 0.627961 |
068c50c300f3e0a0ecf4595aa4e36f2dd8cea7d5 | 5,860 | py | Python | Python3/Tornado/apps/pg/PG_Collection/src/api/handlers/handler_base.py | youngqqcn/QBlockChainNotes | 85122049024dc5555705bf016312491a51966621 | [
"MIT"
] | 24 | 2018-11-01T03:36:43.000Z | 2022-03-28T08:20:30.000Z | Python3/Tornado/apps/pg/PG_Deposit/src/api/handlers/handler_base.py | songning4/QBlockChainNotes | d65ede073f5a20f728f41cc6850409693820cdb1 | [
"MIT"
] | 57 | 2019-12-04T08:26:47.000Z | 2022-03-08T07:35:15.000Z | Python3/Tornado/apps/pg/PG_Collection/src/api/handlers/handler_base.py | youngqqcn/QBlockChainNotes | 85122049024dc5555705bf016312491a51966621 | [
"MIT"
] | 11 | 2019-01-04T08:41:57.000Z | 2022-03-16T03:51:36.000Z | import redis
import tornado.web
import tornado.httpserver
import time
import json
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from tornado.httpclient import HTTPError
import json
import time
from ed25519 import SigningKey, VerifyingKey
from src.config.constant import REDI... | 32.021858 | 109 | 0.568089 |
cb44490b58c7f876ed265f982392278b292f2cec | 2,176 | py | Python | src/models/fmow.py | YugeTen/fish | 333efa24572d99da0a4107ab9cc4af93a915d2a9 | [
"MIT"
] | 71 | 2021-07-12T12:43:57.000Z | 2022-03-29T04:40:22.000Z | src/models/fmow.py | YugeTen/fish | 333efa24572d99da0a4107ab9cc4af93a915d2a9 | [
"MIT"
] | 2 | 2021-07-15T06:48:33.000Z | 2022-02-23T13:34:15.000Z | src/models/fmow.py | YugeTen/fish | 333efa24572d99da0a4107ab9cc4af93a915d2a9 | [
"MIT"
] | 6 | 2021-07-15T11:13:14.000Z | 2022-03-21T16:34:51.000Z | import os
from copy import deepcopy
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from torchvision.models import densenet121
from wilds.common.data_loaders import get_eval_loader
from wilds.datasets.fmow_dataset im... | 35.672131 | 98 | 0.654412 |
8163ac516c0c652e794d28faf6be48a577853ccc | 1,124 | py | Python | 06_P19.py | wiphoo/computer_programing_101 | 59013d774f6ec6e019829d73ce163cf5766c6a48 | [
"MIT"
] | null | null | null | 06_P19.py | wiphoo/computer_programing_101 | 59013d774f6ec6e019829d73ce163cf5766c6a48 | [
"MIT"
] | null | null | null | 06_P19.py | wiphoo/computer_programing_101 | 59013d774f6ec6e019829d73ce163cf5766c6a48 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
inputFileName = input()
# read input file
with open( inputFileName, 'r' ) as inputFile:
inputList = [ line.split() for line in inputFile.readlines() ]
#print('inputList = {}'.format( inputList ) )
fruitNameToPersonsListDict = {}
for fruitName, person in inputList:
personList = fruitName... | 30.378378 | 89 | 0.717972 |
34eae15425bebf2fe815704d4ad028e14e88a637 | 2,996 | py | Python | lib/rucio/tests/test_daemons.py | llwang00/rucio | f49c5c9599e147823110dc6da22a0bc33a881f8e | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/test_daemons.py | llwang00/rucio | f49c5c9599e147823110dc6da22a0bc33a881f8e | [
"Apache-2.0"
] | null | null | null | lib/rucio/tests/test_daemons.py | llwang00/rucio | f49c5c9599e147823110dc6da22a0bc33a881f8e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 CERN
#
# 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... | 29.372549 | 121 | 0.757343 |
a65907ca4c57136bb93eecae920b809c4386c78f | 5,289 | py | Python | visual_cloze.py | linbojun/Deep-Learning-Final-Project | ce9233eac73b13338d19cd03405847d4e58e37d8 | [
"Apache-2.0"
] | null | null | null | visual_cloze.py | linbojun/Deep-Learning-Final-Project | ce9233eac73b13338d19cd03405847d4e58e37d8 | [
"Apache-2.0"
] | null | null | null | visual_cloze.py | linbojun/Deep-Learning-Final-Project | ce9233eac73b13338d19cd03405847d4e58e37d8 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import tensorflow as tf
from preprocessrecipeqa import *
class Model(tf.keras.Model):
def __init__(self, l_embed):
super(Model, self).__init__()
self.image_conv1 = tf.keras.layers.Conv2D(filters = 4, kernel_size = 3, strides=(2, 2), padding='valid')
self.image_conv2 = tf.keras.layers.C... | 40.684615 | 202 | 0.715825 |
50d91de586950bcb5f025bef188fbecc24f754ec | 24,247 | py | Python | lib/modes/mode_starcraft.py | okonomichiyaki/parrot.py | f8a0cee117be3ca80dd16ecb475dee02a2602ce4 | [
"MIT"
] | null | null | null | lib/modes/mode_starcraft.py | okonomichiyaki/parrot.py | f8a0cee117be3ca80dd16ecb475dee02a2602ce4 | [
"MIT"
] | null | null | null | lib/modes/mode_starcraft.py | okonomichiyaki/parrot.py | f8a0cee117be3ca80dd16ecb475dee02a2602ce4 | [
"MIT"
] | null | null | null | from lib.detection_strategies import *
import threading
import numpy as np
import pyautogui
from lib.input_manager import InputManager
from time import sleep
from subprocess import call
from lib.system_toggles import toggle_eyetracker, turn_on_sound, mute_sound, toggle_speechrec
from lib.pattern_detector import Pattern... | 37.767913 | 193 | 0.509011 |
4e2f4728f865e671877a9c34e0648bcffca07e3b | 16,000 | py | Python | discord/coffee.py | korea3500/Toy | 3577489e9d8556a24ebd2c13df81a317b8f83d92 | [
"Apache-2.0"
] | null | null | null | discord/coffee.py | korea3500/Toy | 3577489e9d8556a24ebd2c13df81a317b8f83d92 | [
"Apache-2.0"
] | null | null | null | discord/coffee.py | korea3500/Toy | 3577489e9d8556a24ebd2c13df81a317b8f83d92 | [
"Apache-2.0"
] | null | null | null | from selenium import webdriver
from bs4 import BeautifulSoup
import time, os
import requests
from datetime import datetime
import pandas as pd
from webdriver_manager.chrome import ChromeDriverManager
import discord
import asyncio
import re
from discord.ext import commands
from discord.utils import get
from discord impo... | 37.558685 | 220 | 0.629563 |
846934cd7f7342ca1d67bfe5d5a216b411841700 | 4,178 | py | Python | questions/linked_list/questions.py | alexkeating/computer_science | e464300fd56d8998f3619a0acbc254321b8c18ce | [
"MIT"
] | null | null | null | questions/linked_list/questions.py | alexkeating/computer_science | e464300fd56d8998f3619a0acbc254321b8c18ce | [
"MIT"
] | null | null | null | questions/linked_list/questions.py | alexkeating/computer_science | e464300fd56d8998f3619a0acbc254321b8c18ce | [
"MIT"
] | null | null | null | """
This module contains funstions for each question in the linked list
section of cracking the coding interview.
"""
def remove_dups(linked_list):
"""
Write code to remove duplicates from an unsorted linked list.
How would you solve this problem if a temporary buffer is not
allowed?
O(N^2) - wit... | 28.616438 | 89 | 0.633317 |
2af607853686504317fefa9b5635a9a434769353 | 7,013 | py | Python | doc_ref/NLP/word2vec-nlp-tutorial/DeepLearningMovies/Word2Vec_AverageVectors.py | gtesei/fast-furious | b974e6b71be92ad8892864794af57631291ebac1 | [
"MIT"
] | 19 | 2015-06-24T00:04:11.000Z | 2021-02-28T16:55:44.000Z | doc_ref/NLP/word2vec-nlp-tutorial/DeepLearningMovies/Word2Vec_AverageVectors.py | gtesei/fast-furious | b974e6b71be92ad8892864794af57631291ebac1 | [
"MIT"
] | null | null | null | doc_ref/NLP/word2vec-nlp-tutorial/DeepLearningMovies/Word2Vec_AverageVectors.py | gtesei/fast-furious | b974e6b71be92ad8892864794af57631291ebac1 | [
"MIT"
] | 4 | 2016-10-11T17:36:44.000Z | 2019-08-16T10:03:04.000Z | #!/usr/bin/env python
# Author: Angela Chapman
# Date: 8/6/2014
#
# This file contains code to accompany the Kaggle tutorial
# "Deep learning goes to the movies". The code in this file
# is for Parts 2 and 3 of the tutorial, which cover how to
# train a model using Word2Vec.
#
# **********************... | 37.502674 | 107 | 0.664908 |
dfd74c944116ab6f5951f0f6362300c23a653f83 | 64,464 | py | Python | ros/src/util/packages/runtime_manager/scripts/rtmgr.py | yukkysaito/autoware_thesis | db6e2091b5f518f49e47ebafb18db1a208f46704 | [
"BSD-3-Clause"
] | 7 | 2016-12-19T14:52:59.000Z | 2021-02-10T09:54:49.000Z | ros/src/util/packages/runtime_manager/scripts/rtmgr.py | yukkysaito/autoware_thesis | db6e2091b5f518f49e47ebafb18db1a208f46704 | [
"BSD-3-Clause"
] | null | null | null | ros/src/util/packages/runtime_manager/scripts/rtmgr.py | yukkysaito/autoware_thesis | db6e2091b5f518f49e47ebafb18db1a208f46704 | [
"BSD-3-Clause"
] | 3 | 2016-12-19T14:53:01.000Z | 2020-11-17T14:18:41.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 0.6.8 on Wed Aug 3 11:50:19 2016
#
import wx
# begin wxGlade: dependencies
import gettext
# end wxGlade
# begin wxGlade: extracode
# end wxGlade
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
... | 53.497095 | 172 | 0.76497 |
b2cc5b75bb7d9fb7c83df05839b6156d0de9f7be | 988 | py | Python | setup.py | erickrf/unitex-lemmatizer | 2f3df6dc978001458e9c03e90727dc7c7aa69269 | [
"MIT"
] | 1 | 2017-01-24T15:04:11.000Z | 2017-01-24T15:04:11.000Z | setup.py | erickrf/unitex-lemmatizer | 2f3df6dc978001458e9c03e90727dc7c7aa69269 | [
"MIT"
] | null | null | null | setup.py | erickrf/unitex-lemmatizer | 2f3df6dc978001458e9c03e90727dc7c7aa69269 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Installation setup for unitexlemmatizer
"""
from setuptools import setup, find_packages
with open('README.rst', 'rb') as f:
long_desc = f.read()
setup(name='unitexlemmatizer',
version='1.0.0',
description='A simple lemmatizer based... | 29.058824 | 67 | 0.633603 |
fc00db39ae9ab9e0ac5381964dcbd23f1e7708c3 | 802 | py | Python | Question_01_10/Max Pooling.py | SHK2018/Gasyori100knock | 3fab0a2906ac99a37281269e1618e8ac74629dfa | [
"MIT"
] | 5 | 2021-06-08T16:09:01.000Z | 2021-12-10T09:42:43.000Z | Question_01_10/Max Pooling.py | SHK2018/Gasyori100knock | 3fab0a2906ac99a37281269e1618e8ac74629dfa | [
"MIT"
] | null | null | null | Question_01_10/Max Pooling.py | SHK2018/Gasyori100knock | 3fab0a2906ac99a37281269e1618e8ac74629dfa | [
"MIT"
] | 1 | 2021-05-24T04:14:27.000Z | 2021-05-24T04:14:27.000Z | # -*- coding: utf-8 -*-
import cv2
import numpy as np
def max_pooling(img, ksize):
H, W, C = img.shape
out = np.zeros_like(img, dtype=np.float32)
for i in range(0, H, ksize):
for j in range(0, H, ksize):
start_i = i
end_i = i + ksize
start_j = j
end... | 23.588235 | 77 | 0.600998 |
7b394a15dac43de723f5da1437a7bd8cd13016fb | 494 | py | Python | mmf/__init__.py | sisilmehta2000/mmf | ac1bb736f281ffbde367cfe9cf6f4f78fc890fc4 | [
"BSD-3-Clause"
] | 1 | 2022-01-14T05:46:04.000Z | 2022-01-14T05:46:04.000Z | mmf/__init__.py | sisilmehta2000/mmf | ac1bb736f281ffbde367cfe9cf6f4f78fc890fc4 | [
"BSD-3-Clause"
] | null | null | null | mmf/__init__.py | sisilmehta2000/mmf | ac1bb736f281ffbde367cfe9cf6f4f78fc890fc4 | [
"BSD-3-Clause"
] | 1 | 2021-11-27T23:29:10.000Z | 2021-11-27T23:29:10.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# isort:skip_file
# flake8: noqa: F401
from mmf.utils.patch import patch_transformers
patch_transformers()
from mmf import utils, common, modules, datasets, models
from mmf.modules import losses, schedulers, optimizers, metrics, poolers
from mmf.version import __vers... | 19.76 | 72 | 0.686235 |
4ff8543cff289f53855e11f9e6567321b99b5572 | 658 | py | Python | python/BubbleSort.py | Rebaiahmed/hacktoberfest-2020 | b60cf24dc1d761e261ad5a00486c2a5b75d1fcf6 | [
"MIT"
] | 51 | 2020-09-27T15:28:05.000Z | 2021-09-29T02:07:25.000Z | python/BubbleSort.py | Rebaiahmed/hacktoberfest-2020 | b60cf24dc1d761e261ad5a00486c2a5b75d1fcf6 | [
"MIT"
] | 158 | 2020-09-26T12:57:12.000Z | 2020-11-01T19:34:31.000Z | python/BubbleSort.py | Rebaiahmed/hacktoberfest-2020 | b60cf24dc1d761e261ad5a00486c2a5b75d1fcf6 | [
"MIT"
] | 453 | 2020-09-27T12:34:35.000Z | 2021-10-16T08:33:33.000Z | # Python program for implementation of Bubble Sort
def bubbleSort(arr):
n = len(arr)
# Traverse through all array elements
for i in range(n):
# Last i elements are already in place
for j in range(0, n-i-1):
# traverse the array from 0 to n-i-1
# Sw... | 24.37037 | 52 | 0.534954 |
0a467d570d4285e7189fea05fd375a74a3a688dc | 1,685 | py | Python | terminology/snomed_ct/terminology.py | drgriffis/text-essence | db3cacc484d31cbb7c3e9120643120e18a91c3af | [
"BSD-3-Clause"
] | 7 | 2021-03-26T07:10:40.000Z | 2021-08-09T14:24:56.000Z | terminology/snomed_ct/terminology.py | drgriffis/text-essence | db3cacc484d31cbb7c3e9120643120e18a91c3af | [
"BSD-3-Clause"
] | 1 | 2021-08-09T15:31:48.000Z | 2021-08-09T15:32:20.000Z | terminology/snomed_ct/terminology.py | drgriffis/text-essence | db3cacc484d31cbb7c3e9120643120e18a91c3af | [
"BSD-3-Clause"
] | null | null | null | from .parsers import *
from hedgepig_logger import log
class SnomedTerminology:
def __init__(self, concepts_file, descriptions_file, definitions_file, language_codes=None, verbose=False):
concepts_by_ID = {}
if verbose:
status = lambda s: log.writeln('[SnomedTerminology] %s' % s)
... | 34.387755 | 111 | 0.623739 |
9e359a7006040cc85de22a60bc84c4eb5c105450 | 2,413 | py | Python | pingmystuff/main.py | larssont/PingMyStuff | 22fb1aa12b88b2a8de37a2fc35ec3367f364f1c5 | [
"MIT"
] | null | null | null | pingmystuff/main.py | larssont/PingMyStuff | 22fb1aa12b88b2a8de37a2fc35ec3367f364f1c5 | [
"MIT"
] | null | null | null | pingmystuff/main.py | larssont/PingMyStuff | 22fb1aa12b88b2a8de37a2fc35ec3367f364f1c5 | [
"MIT"
] | null | null | null | import requests
import yaml
import argparse
from cerberus import Validator
from schema_config import schema
config = {}
def load_config(file):
global config
with open(file) as file:
config = yaml.load(file, Loader=yaml.FullLoader)
def write_config(file):
with open(file, "w") as file:
ya... | 24.13 | 80 | 0.663489 |
e9126de03f747fc365be94fcbb96e4f118c456a3 | 1,007 | py | Python | property/migrations/0010_owner.py | A1exander-Pro/real_estate_lesson | 95a7fe12338e39baf23204605b8c37cb53c43f81 | [
"MIT"
] | null | null | null | property/migrations/0010_owner.py | A1exander-Pro/real_estate_lesson | 95a7fe12338e39baf23204605b8c37cb53c43f81 | [
"MIT"
] | null | null | null | property/migrations/0010_owner.py | A1exander-Pro/real_estate_lesson | 95a7fe12338e39baf23204605b8c37cb53c43f81 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2021-02-09 14:06
from django.db import migrations, models
import phonenumber_field.modelfields
class Migration(migrations.Migration):
dependencies = [
('property', '0009_auto_20210209_1430'),
]
operations = [
migrations.CreateModel(
name='Owner... | 40.28 | 175 | 0.658391 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.