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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8f7d7084909d6e9fff3a65e3652a09f7da33f703 | 442 | py | Python | x_5_5.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | x_5_5.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | 1 | 2021-11-13T08:03:04.000Z | 2021-11-13T08:03:04.000Z | x_5_5.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | # x_5_5
#
# 桃太郎(Human)と同じようにOnitaijiMemberを継承して「Dog、Monkey、Bird」の3つのクラスを作り
# 「犬は噛みつきました」「さるは引っ掻きました」「きじ はくちばしで突きました」と表示してください
class OnitaijiMember:
def __init__(self, name, hit_points):
self.name = name
self.hit_points = hit_points
class Human(OnitaijiMember):
def attack(self):
print(... | 19.217391 | 64 | 0.699095 |
112291aee2513ee1b3b2a5cf43839d135df2f365 | 22,659 | py | Python | bbp/comps/fas.py | ZhangHCFJEA/bbp | 33bd999cf8d719c49f9a904872c62f02eb5850d1 | [
"BSD-3-Clause"
] | 28 | 2017-10-31T09:16:30.000Z | 2022-02-28T23:44:29.000Z | bbp/comps/fas.py | ZhangHCFJEA/bbp | 33bd999cf8d719c49f9a904872c62f02eb5850d1 | [
"BSD-3-Clause"
] | 37 | 2017-05-23T15:15:35.000Z | 2022-02-05T09:13:18.000Z | bbp/comps/fas.py | ZhangHCFJEA/bbp | 33bd999cf8d719c49f9a904872c62f02eb5850d1 | [
"BSD-3-Clause"
] | 26 | 2017-09-21T17:43:33.000Z | 2021-11-29T06:34:30.000Z | #!/usr/bin/env python
"""
Copyright 2010-2017 University Of Southern California
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by appli... | 43.65896 | 81 | 0.558145 |
023acfacadcfad3e947090d1e547141642dd8e7d | 5,447 | py | Python | features/0006-awses-message-decryption-generation-generate.py | seebees/aws-crypto-tools-test-vector-framework | 1779b438f23cb356d5cab7ca40068dcb827b4cb1 | [
"Apache-2.0"
] | 6 | 2019-05-27T19:43:16.000Z | 2021-10-20T15:07:36.000Z | features/0006-awses-message-decryption-generation-generate.py | seebees/aws-crypto-tools-test-vector-framework | 1779b438f23cb356d5cab7ca40068dcb827b4cb1 | [
"Apache-2.0"
] | 11 | 2019-04-10T18:58:23.000Z | 2020-07-09T23:43:02.000Z | features/0006-awses-message-decryption-generation-generate.py | seebees/aws-crypto-tools-test-vector-framework | 1779b438f23cb356d5cab7ca40068dcb827b4cb1 | [
"Apache-2.0"
] | 12 | 2019-03-18T22:29:01.000Z | 2022-03-16T00:11:51.000Z | # Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 30.601124 | 108 | 0.541399 |
91e15358e19b70616910be15d592b70c3a3eaf88 | 4,008 | py | Python | docs/examples/python/scell_test_postgres.py | radetsky/themis | 18ea2e39a7258e23ca9a5bb642691a9431c63d0b | [
"Apache-2.0"
] | 1,561 | 2015-05-20T05:19:29.000Z | 2022-03-31T17:32:55.000Z | docs/examples/python/scell_test_postgres.py | radetsky/themis | 18ea2e39a7258e23ca9a5bb642691a9431c63d0b | [
"Apache-2.0"
] | 536 | 2015-05-20T13:57:08.000Z | 2022-03-15T18:02:59.000Z | docs/examples/python/scell_test_postgres.py | radetsky/themis | 18ea2e39a7258e23ca9a5bb642691a9431c63d0b | [
"Apache-2.0"
] | 141 | 2015-05-20T13:22:45.000Z | 2022-03-29T01:29:40.000Z | #
# Copyright (c) 2015 Cossack Labs Limited
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 36.436364 | 90 | 0.662924 |
25b121d091c4cc802e2826591fee1af978b68e66 | 859 | py | Python | lasttester/contrib/base/cache_shelve.py | gitdachong/lasttester | 4c637d7704e9d577050e666f6ce01fc5d3752044 | [
"MIT"
] | null | null | null | lasttester/contrib/base/cache_shelve.py | gitdachong/lasttester | 4c637d7704e9d577050e666f6ce01fc5d3752044 | [
"MIT"
] | null | null | null | lasttester/contrib/base/cache_shelve.py | gitdachong/lasttester | 4c637d7704e9d577050e666f6ce01fc5d3752044 | [
"MIT"
] | null | null | null | #coding:utf-8
import shelve
import os
from ..utils import util_path
class CacheShelve():
def __init__(self,filename = ''):
self.file_name = 'lasttester_temp_shelve_cache'
if not filename:
import tempfile
filename = os.path.join(tempfile.gettempdir(),self.file_name)
i... | 24.542857 | 73 | 0.575087 |
ced52f884db31f6eb51e14bf8486482c17d2333d | 2,499 | py | Python | My_Model.py | block98k/MyKerasModel | 9db513714d93b667a91ed73ed7bf0de8dc18de30 | [
"Apache-2.0"
] | null | null | null | My_Model.py | block98k/MyKerasModel | 9db513714d93b667a91ed73ed7bf0de8dc18de30 | [
"Apache-2.0"
] | null | null | null | My_Model.py | block98k/MyKerasModel | 9db513714d93b667a91ed73ed7bf0de8dc18de30 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from keras.layers import Input,Lambda
from keras import backend as K
from keras import metrics
from keras import optimizers
from keras.models import Model,Sequential
from keras.layers.advanced_activations import LeakyReLU... | 33.77027 | 86 | 0.673469 |
ef091809adbe283a1d9e59dd4e3b503656f90b58 | 1,097 | py | Python | v1/projects/serializers/project.py | buckyroberts/Website-API | e74d202a41533c7622acbe12c793d047d44012ad | [
"MIT"
] | 64 | 2020-10-02T02:58:06.000Z | 2022-01-29T20:00:50.000Z | v1/projects/serializers/project.py | buckyroberts/Website-API | e74d202a41533c7622acbe12c793d047d44012ad | [
"MIT"
] | 93 | 2020-10-04T22:53:46.000Z | 2022-03-05T18:17:46.000Z | v1/projects/serializers/project.py | buckyroberts/Website-API | e74d202a41533c7622acbe12c793d047d44012ad | [
"MIT"
] | 21 | 2020-10-11T14:16:13.000Z | 2021-11-09T17:50:25.000Z | from rest_framework import serializers
from ..models.project import Project
from ..serializers.milestone import MilestoneSerializer
class ProjectSerializer(serializers.ModelSerializer):
milestones = serializers.SerializerMethodField()
project_lead_display_name = serializers.CharField(source='project_lead.use... | 30.472222 | 110 | 0.61258 |
fe310e08a5d7f118323661753954675ecb8a8c7b | 212 | py | Python | CoV19/bots/urls.py | just-ary27/CovBot-revamp | 31af847237c4c5e7d5086a78950d06ecfd81318f | [
"MIT"
] | 1 | 2021-05-12T18:44:30.000Z | 2021-05-12T18:44:30.000Z | CoV19/bots/urls.py | just-ary27/CovBot-revamp | 31af847237c4c5e7d5086a78950d06ecfd81318f | [
"MIT"
] | 2 | 2021-09-22T18:41:37.000Z | 2022-02-10T09:28:52.000Z | CoV19/bots/urls.py | just-ary27/CovBot-revamp | 31af847237c4c5e7d5086a78950d06ecfd81318f | [
"MIT"
] | null | null | null | from django.urls import path,include
from . import views
urlpatterns = [
path('',views.bots),
path('features',views.features),
path('commands',views.commands),
path('tutorial',views.tutorial),
]
| 21.2 | 36 | 0.683962 |
8f831af90751c0fa63f819d5d22f631555638324 | 2,336 | py | Python | WebCrawler/recaptcha.py | psilva-leo/WebCrawler | a29baff6470f953f064fd274e847ac94385f72d3 | [
"MIT"
] | null | null | null | WebCrawler/recaptcha.py | psilva-leo/WebCrawler | a29baff6470f953f064fd274e847ac94385f72d3 | [
"MIT"
] | null | null | null | WebCrawler/recaptcha.py | psilva-leo/WebCrawler | a29baff6470f953f064fd274e847ac94385f72d3 | [
"MIT"
] | null | null | null | import scrapy
from twisted.internet.defer import inlineCallbacks
from selenium import webdriver
import os
import time
from random import randint
import urllib.request
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.b... | 33.371429 | 88 | 0.690068 |
ed6424ea57b32a1661e0f57ca0bda6a26b30c740 | 3,433 | py | Python | day9.py | GeirOwe/adventOfCode | fee1420cb8ecce8b7aaf9d48472364be191ca2a2 | [
"MIT"
] | 1 | 2021-12-20T11:10:59.000Z | 2021-12-20T11:10:59.000Z | day9.py | GeirOwe/adventOfCode | fee1420cb8ecce8b7aaf9d48472364be191ca2a2 | [
"MIT"
] | null | null | null | day9.py | GeirOwe/adventOfCode | fee1420cb8ecce8b7aaf9d48472364be191ca2a2 | [
"MIT"
] | 1 | 2021-12-02T14:40:12.000Z | 2021-12-02T14:40:12.000Z | # advent of code
# response to the challenge by geir owe
# day9 - challenge: https://adventofcode.com/2020/day/9
#start function
def get_all_port_data(port_file):
codeList = []
#move all instructions in the boot file into a list
for code in port_file:
code = int(code.strip())
codeList.appe... | 33.990099 | 108 | 0.617827 |
653558b6f7edef4c296743980b0b333e67fd63db | 490 | py | Python | templateSolution.py | DmitryNaimark/leetcode-solutions-python | 16af5f3a9cb8469d82b14c8953847f0e93a92324 | [
"MIT"
] | 1 | 2019-10-31T11:06:23.000Z | 2019-10-31T11:06:23.000Z | templateSolution.py | DmitryNaimark/leetcode-solutions-python | 16af5f3a9cb8469d82b14c8953847f0e93a92324 | [
"MIT"
] | null | null | null | templateSolution.py | DmitryNaimark/leetcode-solutions-python | 16af5f3a9cb8469d82b14c8953847f0e93a92324 | [
"MIT"
] | null | null | null | # LeetCode Problem URL
# ---------------------------------------------------
# Runtime Complexity: O(?)
# Space Complexity: O(?)
# Idea:
# Solution
# ---------------------------------------------------
# Uses DN functions:
# ---------------------------------------------------
# --------------------... | 23.333333 | 53 | 0.265306 |
146a17f784fb5239679806642ea5947ca36d8944 | 24,271 | py | Python | Packs/Elasticsearch/Integrations/Elasticsearch_v2/Elasticsearch_v2.py | mchasepan/content | 177c7fe86c4872141107f48075c6578daffc4bd4 | [
"MIT"
] | null | null | null | Packs/Elasticsearch/Integrations/Elasticsearch_v2/Elasticsearch_v2.py | mchasepan/content | 177c7fe86c4872141107f48075c6578daffc4bd4 | [
"MIT"
] | 2 | 2019-09-18T08:11:22.000Z | 2020-11-24T18:50:28.000Z | Packs/Elasticsearch/Integrations/Elasticsearch_v2/Elasticsearch_v2.py | mchasepan/content | 177c7fe86c4872141107f48075c6578daffc4bd4 | [
"MIT"
] | 2 | 2020-10-11T18:01:32.000Z | 2020-10-14T03:21:23.000Z | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
'''IMPORTS'''
from typing import List
from elasticsearch import Elasticsearch, RequestsHttpConnection, NotFoundError
from elasticsearch_dsl import Search
from elasticsearch_dsl.query import QueryString
from datetime imp... | 37.805296 | 119 | 0.64781 |
9b2c51e29299a52c7d7b62eb4bf413c8c617f17a | 377 | py | Python | examples/projects/store_demoqa/tests/header/search_for_a_product.py | vault-the/golem | 3bd132685b148c0d9c12deeebfc00569d07063e4 | [
"MIT"
] | null | null | null | examples/projects/store_demoqa/tests/header/search_for_a_product.py | vault-the/golem | 3bd132685b148c0d9c12deeebfc00569d07063e4 | [
"MIT"
] | null | null | null | examples/projects/store_demoqa/tests/header/search_for_a_product.py | vault-the/golem | 3bd132685b148c0d9c12deeebfc00569d07063e4 | [
"MIT"
] | null | null | null |
description = ''
pages = ['header',
'checkout',
'search_result']
def setup(data):
pass
def test(data):
navigate('http://store.demoqa.com/')
send_keys(header.search_input, 'mouse')
press_key(header.search_input, 'ENTER')
search_result.verify_product_in_results('Magic Mouse')
... | 17.952381 | 58 | 0.65252 |
edcb04f43c91df6250a54cfcae424cd9a7bba3f9 | 11,503 | py | Python | nrfjprog/model/perform_command_jlink.py | strobo-inc/nrfjprog | 3c5667959948081aba44ca8981544a9df0dffae6 | [
"BSD-3-Clause"
] | null | null | null | nrfjprog/model/perform_command_jlink.py | strobo-inc/nrfjprog | 3c5667959948081aba44ca8981544a9df0dffae6 | [
"BSD-3-Clause"
] | null | null | null | nrfjprog/model/perform_command_jlink.py | strobo-inc/nrfjprog | 3c5667959948081aba44ca8981544a9df0dffae6 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2016, Nordic Semiconductor
# 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 ... | 34.235119 | 186 | 0.62801 |
67ae2a9e34caa0ead78a1726dfbcf1036eb0204a | 429 | py | Python | Program/storage/entity_storage.py | AntonPashkowskiy/Tars | 07cf1a7eb466c763ffb7ab46cd173d76067fe9d3 | [
"MIT"
] | null | null | null | Program/storage/entity_storage.py | AntonPashkowskiy/Tars | 07cf1a7eb466c763ffb7ab46cd173d76067fe9d3 | [
"MIT"
] | null | null | null | Program/storage/entity_storage.py | AntonPashkowskiy/Tars | 07cf1a7eb466c763ffb7ab46cd173d76067fe9d3 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from storage.interfaces.entity_storage_interface import EntityStorageInterface
class EntityStorage(EntityStorageInterface):
def __init__(self, target_collection):
self._target_collection = target_collection
def create(entity):
pass
def read(entity_id):
pass
... | 19.5 | 78 | 0.680653 |
747054636644d011a3f3e2735fa8f2617e73d05c | 2,085 | py | Python | server/ioctl/app/crud/base.py | amr390/ioctl | ca6bd9bbebcf366c60359a2265b20083be87e48c | [
"MIT"
] | null | null | null | server/ioctl/app/crud/base.py | amr390/ioctl | ca6bd9bbebcf366c60359a2265b20083be87e48c | [
"MIT"
] | null | null | null | server/ioctl/app/crud/base.py | amr390/ioctl | ca6bd9bbebcf366c60359a2265b20083be87e48c | [
"MIT"
] | null | null | null | from typing import Any, Dict, Generic, List, Optional, Type, TypeVar, Union
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel
from sqlalchemy.orm import Session
from app.db.base_class import Base
ModelType = TypeVar("ModelType", bound=Base)
CreateSchemaType = TypeVar("CreateSchemaType", bo... | 30.661765 | 78 | 0.62494 |
6fc0f5058b7906a39e05db39ec9476f51afd4b77 | 11,541 | py | Python | Source/fluxes.py | vmmunoza/-HawkHunter | d35d9820df8aa29faa2908d4d1f35204b7c0edf9 | [
"MIT"
] | 1 | 2022-03-25T12:04:54.000Z | 2022-03-25T12:04:54.000Z | Source/fluxes.py | vmmunoza/-HawkHunter | d35d9820df8aa29faa2908d4d1f35204b7c0edf9 | [
"MIT"
] | null | null | null | Source/fluxes.py | vmmunoza/-HawkHunter | d35d9820df8aa29faa2908d4d1f35204b7c0edf9 | [
"MIT"
] | 3 | 2022-03-30T02:02:10.000Z | 2022-03-30T09:20:34.000Z | #-------------------------------
# Compute the neutrino fluxes
#-------------------------------
from Source.evaporation import *
#-------
# Generic stuff
#-------
# Number density of PBHs n_pbh at z = 0 (cm^-3)
# beta and f_pbh defined outside of the function (i.e., f_PBH=1 or beta'=1 for this formula, scale it late... | 41.66426 | 175 | 0.616844 |
5f09be7991c6fb90c60a9464eb765c758129ef52 | 821 | py | Python | src/Day30_MinimizeDeviationInArray.py | ruarfff/leetcode-jan-2021 | 9436c0d6b82e83c0b21a498c998fa9e41d443d3c | [
"MIT"
] | null | null | null | src/Day30_MinimizeDeviationInArray.py | ruarfff/leetcode-jan-2021 | 9436c0d6b82e83c0b21a498c998fa9e41d443d3c | [
"MIT"
] | null | null | null | src/Day30_MinimizeDeviationInArray.py | ruarfff/leetcode-jan-2021 | 9436c0d6b82e83c0b21a498c998fa9e41d443d3c | [
"MIT"
] | null | null | null | from typing import List
import heapq
import math
class Solution:
def minimumDeviation(self, nums: List[int]) -> int:
vals = []
minimum = math.inf
minimum_deviation = math.inf
for n in nums:
if n % 2 == 0:
vals.append(-n)
minimum = min(mi... | 24.878788 | 67 | 0.493301 |
77729546eba505d873b63149ce257117ad211fcc | 1,567 | py | Python | config.py | KacperMayday/Snake-Genetic-Algorithm | dfb5bd20b06e82e2646b7843a439d67cca1dd957 | [
"MIT"
] | 1 | 2020-03-14T22:09:19.000Z | 2020-03-14T22:09:19.000Z | config.py | KacperMayday/Snake-Genetic-Algorithm | dfb5bd20b06e82e2646b7843a439d67cca1dd957 | [
"MIT"
] | null | null | null | config.py | KacperMayday/Snake-Genetic-Algorithm | dfb5bd20b06e82e2646b7843a439d67cca1dd957 | [
"MIT"
] | null | null | null | """Configuration file containing global variables and hyperparameters.
Constants
---------
SCREENWIDTH, SCREENHEIGHT : int
Screen resolution parameters. For training purpose I recommend setting
as small values as possible to make the process faster.
TICKRATE: int
Indicates maximum frames per second. For tr... | 31.979592 | 92 | 0.760689 |
43c05848396c01f1e695abdf3f05d7c4ac6bf6bc | 200 | py | Python | aug/ops/__init__.py | cta-ai/aug | b4efc82874653e2cd0f6b48426568108ee40afd0 | [
"Apache-2.0"
] | 7 | 2019-07-15T23:01:58.000Z | 2019-09-25T19:35:07.000Z | aug/ops/__init__.py | tgilewicz/aug | b4efc82874653e2cd0f6b48426568108ee40afd0 | [
"Apache-2.0"
] | null | null | null | aug/ops/__init__.py | tgilewicz/aug | b4efc82874653e2cd0f6b48426568108ee40afd0 | [
"Apache-2.0"
] | 3 | 2020-06-30T06:36:03.000Z | 2021-11-04T09:04:47.000Z | from os.path import dirname, basename, isfile
import glob
modules = glob.glob(dirname(__file__) + "/*.py")
__all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
| 40 | 92 | 0.715 |
0159d53a180aa8c00ad4d6f2db9467f34e56b66a | 876 | py | Python | day9.py | kdrag0n/aoc2021 | 469bd861a7d7c0add14412a705ec4cb1e1b5a10f | [
"MIT"
] | 2 | 2021-12-04T21:15:14.000Z | 2021-12-12T09:28:28.000Z | day9.py | kdrag0n/aoc2021 | 469bd861a7d7c0add14412a705ec4cb1e1b5a10f | [
"MIT"
] | null | null | null | day9.py | kdrag0n/aoc2021 | 469bd861a7d7c0add14412a705ec4cb1e1b5a10f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
def ints(itr):
return [int(i) for i in itr]
with open(sys.argv[1], 'r') as f:
file_lines = [l for l in f.read().strip().split('\n')]
in_nums = []
total = 0
result = 0
other = 0
grid=[]
while True:
for l in file_lines:
vals = [int(x) for x in list(l)]
... | 18.25 | 68 | 0.481735 |
614c98401e90ebb88ad490d19c083574eeab8b14 | 22,837 | py | Python | fsm.py | jwang0306/NBA-info-bot | 4765900043ba4f4481338f865ef2d598462dc558 | [
"MIT"
] | 1 | 2018-12-19T12:15:45.000Z | 2018-12-19T12:15:45.000Z | fsm.py | Jens0306/NBA_and_Movie_Bot | 4765900043ba4f4481338f865ef2d598462dc558 | [
"MIT"
] | 4 | 2020-03-24T16:29:12.000Z | 2021-12-13T19:53:14.000Z | fsm.py | Jens0306/NBA_and_Movie_Bot | 4765900043ba4f4481338f865ef2d598462dc558 | [
"MIT"
] | null | null | null | from transitions.extensions import GraphMachine
from utils import *
from web_scraper import *
import nltk
from nltk.tokenize import sent_tokenize
from nltk.tokenize import word_tokenize
import random
mytext = "Oh yeah lakers!"
print("================================")
# print(word_tokenize(mytext))
print("=========... | 33.145138 | 198 | 0.465079 |
ea9334b81ee9177869b41f96fb5540940e2c00aa | 149 | py | Python | tests/parser/builtins.10a.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/builtins.10a.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/builtins.10a.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | input = """
a("10.28399"). a("3.7").
b(X,Y) :- a(X), a(Y), X > Y.
"""
output = """
a("10.28399"). a("3.7").
b(X,Y) :- a(X), a(Y), X > Y.
"""
| 13.545455 | 29 | 0.342282 |
be0ef680258757e68cd5f57d4c0c92c75262bae4 | 14,536 | py | Python | venv/lib/python3.5/site-packages/radon/tests/test_cli_tools.py | prashant0598/CoffeeApp | 4fa006aebf06e12ed34766450ddcfa548ee63307 | [
"MIT"
] | null | null | null | venv/lib/python3.5/site-packages/radon/tests/test_cli_tools.py | prashant0598/CoffeeApp | 4fa006aebf06e12ed34766450ddcfa548ee63307 | [
"MIT"
] | null | null | null | venv/lib/python3.5/site-packages/radon/tests/test_cli_tools.py | prashant0598/CoffeeApp | 4fa006aebf06e12ed34766450ddcfa548ee63307 | [
"MIT"
] | null | null | null | import os
import sys
import json
import unittest
import radon.cli.tools as tools
from radon.visitors import Function, Class
from radon.raw import Module
try:
import unittest.mock as mock
except ImportError:
import mock
from paramunittest import parametrized
def fake_isfile(filename):
if filename == 'file.... | 42.133333 | 114 | 0.476059 |
d4c29269dec60fcf36d30990ccae2bd06791ebc5 | 3,538 | py | Python | v1.0.0.test/toontown/coghq/FactoryEntityCreatorAI.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-01T15:46:43.000Z | 2021-07-23T16:26:48.000Z | v1.0.0.test/toontown/coghq/FactoryEntityCreatorAI.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 1 | 2019-06-29T03:40:05.000Z | 2021-06-13T01:15:16.000Z | v1.0.0.test/toontown/coghq/FactoryEntityCreatorAI.py | TTOFFLINE-LEAK/ttoffline | bb0e91704a755d34983e94288d50288e46b68380 | [
"MIT"
] | 4 | 2019-07-28T21:18:46.000Z | 2021-02-25T06:37:25.000Z | from otp.level import EntityCreatorAI
from direct.showbase.PythonUtil import Functor
import DistributedBeanBarrelAI, DistributedButtonAI, DistributedCrateAI, DistributedLiftAI, DistributedDoorEntityAI, DistributedGagBarrelAI, DistributedGridAI
from toontown.suit import DistributedGridGoonAI
from toontown.suit import Di... | 69.372549 | 345 | 0.745336 |
830606e81df0f46cb03050ec083842683c611660 | 5,238 | py | Python | tests/layers/test_gated_average_layer.py | vishalbelsare/neupy | 684313cdaddcad326f2169384fb15ec3aa29d991 | [
"MIT"
] | null | null | null | tests/layers/test_gated_average_layer.py | vishalbelsare/neupy | 684313cdaddcad326f2169384fb15ec3aa29d991 | [
"MIT"
] | null | null | null | tests/layers/test_gated_average_layer.py | vishalbelsare/neupy | 684313cdaddcad326f2169384fb15ec3aa29d991 | [
"MIT"
] | null | null | null | import numpy as np
from neupy import layers
from neupy.utils import asfloat
from neupy.exceptions import LayerConnectionError
from base import BaseTestCase
class GatedAverageTestCase(BaseTestCase):
def test_gated_average_layer_negative_index(self):
gated_avg_layer = layers.GatedAverage(gating_layer_inde... | 38.514706 | 79 | 0.605002 |
aa7e82b5c9c4b12c8050fe564d702b4f9229fe56 | 1,610 | py | Python | plotboi.py | RustyBamboo/hash-shader | 2604a7885f9db97518d832a997d387e78f873fa2 | [
"MIT"
] | 41 | 2021-04-25T23:22:02.000Z | 2022-03-20T16:46:53.000Z | plotboi.py | RustyBamboo/hash-shader | 2604a7885f9db97518d832a997d387e78f873fa2 | [
"MIT"
] | null | null | null | plotboi.py | RustyBamboo/hash-shader | 2604a7885f9db97518d832a997d387e78f873fa2 | [
"MIT"
] | 3 | 2021-06-28T17:07:44.000Z | 2022-03-10T04:25:51.000Z | #!/usr/bin/env python2
import subprocess
import sys
import os
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import cpuinfo
class BlockChainValidator:
def __init__(self, cmd, name, color):
self.data = []
self.cmd = os.path.join(os.path.dirname(__file__), ... | 34.255319 | 117 | 0.668944 |
e63ba48516c1aa461a410b7890320226c46bd08f | 104 | py | Python | cooler/_version.py | mirnylab/cooler | 987e87dd357c99a0a070b8a25cb7aaef86f1655c | [
"BSD-3-Clause"
] | 106 | 2016-01-15T21:24:41.000Z | 2020-09-24T12:15:13.000Z | cooler/_version.py | mirnylab/cooler | 987e87dd357c99a0a070b8a25cb7aaef86f1655c | [
"BSD-3-Clause"
] | 190 | 2016-02-16T03:35:30.000Z | 2020-09-25T19:16:28.000Z | cooler/_version.py | mirnylab/cooler | 987e87dd357c99a0a070b8a25cb7aaef86f1655c | [
"BSD-3-Clause"
] | 43 | 2016-08-26T18:51:21.000Z | 2020-09-08T13:38:50.000Z | __version__ = "0.8.11"
__format_version__ = 3
__format_version_mcool__ = 2
__format_version_scool__ = 1
| 20.8 | 28 | 0.807692 |
97a796b0c4d88779d1248191f979cdf202b7d2da | 5,165 | py | Python | local/cpp_algorithms/common_helpers.py | andresperez86/vision_cpp | 505d524f598e1b31f4d80f909cf9d8fd21f5dbe5 | [
"MIT"
] | 1 | 2021-09-16T06:13:09.000Z | 2021-09-16T06:13:09.000Z | local/cpp_algorithms/common_helpers.py | andresperez86/vision_cpp | 505d524f598e1b31f4d80f909cf9d8fd21f5dbe5 | [
"MIT"
] | null | null | null | local/cpp_algorithms/common_helpers.py | andresperez86/vision_cpp | 505d524f598e1b31f4d80f909cf9d8fd21f5dbe5 | [
"MIT"
] | null | null | null | """
Some helper functions that are often used.
"""
import numpy as np
import matplotlib.pyplot as plt
from .constants import OB, NO
from pathlib import Path
from PIL import Image
RES = [(32, 32), (50, 50), (50, 144), (144, 255), (256, 256)]
def adjacency_test(path, exactly_one=True):
"""
Checks all points in... | 23.692661 | 68 | 0.571926 |
6bdcc4ec6a85384ec927ff120aa0b58a62dd6264 | 889 | py | Python | conda_lock/src_parser/selectors.py | kev-zheng/conda-lock | 2717932c6a0d1a5fab4546fafe2d2f85e378f3ba | [
"MIT"
] | 30 | 2019-09-09T17:09:25.000Z | 2022-03-02T18:47:49.000Z | conda_lock/src_parser/selectors.py | kev-zheng/conda-lock | 2717932c6a0d1a5fab4546fafe2d2f85e378f3ba | [
"MIT"
] | 25 | 2019-09-13T18:43:37.000Z | 2020-08-15T16:50:01.000Z | conda_lock/src_parser/selectors.py | kev-zheng/conda-lock | 2717932c6a0d1a5fab4546fafe2d2f85e378f3ba | [
"MIT"
] | 9 | 2019-09-13T15:37:02.000Z | 2021-09-04T02:13:24.000Z | import re
from typing import Iterator
def filter_platform_selectors(content: str, platform) -> Iterator[str]:
""""""
# we support a very limited set of selectors that adhere to platform only
platform_sel = {
"linux-64": {"linux64", "unix", "linux"},
"linux-aarch64": {"aarch64", "unix", "l... | 30.655172 | 77 | 0.527559 |
1dfd26485eea7253d05518bbe4fa394757c4acbb | 14,632 | py | Python | tests/sentry/lang/native/test_plugin.py | noscripter/sentry | 1c5b1b53e740ffd2747afb7f0995e026be9468d0 | [
"BSD-3-Clause"
] | 1 | 2021-01-13T15:40:03.000Z | 2021-01-13T15:40:03.000Z | tests/sentry/lang/native/test_plugin.py | fotinakis/sentry | c5cfa5c5e47475bf5ef41e702548c2dfc7bb8a7c | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/lang/native/test_plugin.py | fotinakis/sentry | c5cfa5c5e47475bf5ef41e702548c2dfc7bb8a7c | [
"BSD-3-Clause"
] | 1 | 2019-11-01T14:48:32.000Z | 2019-11-01T14:48:32.000Z | from __future__ import absolute_import
from mock import patch
from sentry.models import Event
from sentry.testutils import requires_llvm_symbolizer, TestCase
from sentry.lang.native.symbolizer import Symbolizer
@requires_llvm_symbolizer
class BasicResolvingIntegrationTest(TestCase):
@patch('sentry.lang.native.... | 39.227882 | 93 | 0.362356 |
f7e5944768414b173c54865a6ddf2d931753fbc6 | 2,228 | py | Python | tests/contrib/django/test_django_patch.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 308 | 2016-12-07T16:49:27.000Z | 2022-03-15T10:06:45.000Z | tests/contrib/django/test_django_patch.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1,928 | 2016-11-28T17:13:18.000Z | 2022-03-31T21:43:19.000Z | tests/contrib/django/test_django_patch.py | p7g/dd-trace-py | 141ac0ab6e9962e3b3bafc9de172076075289a19 | [
"Apache-2.0",
"BSD-3-Clause"
] | 311 | 2016-11-27T03:01:49.000Z | 2022-03-18T21:34:03.000Z | from ddtrace.contrib.django import patch
from tests.contrib.patch import PatchTestCase
class TestDjangoPatch(PatchTestCase.Base):
__integration_name__ = "django"
__module_name__ = "django"
__patch_func__ = patch
__unpatch_func__ = None
def assert_module_patched(self, django):
self.assert_... | 51.813953 | 93 | 0.748654 |
e48d22c11a99afabbbf8f8376da09f289e92b69e | 1,760 | py | Python | picture/migrations/0001_initial.py | Michellemukami/django-image | 754a4b0ce32415383f99f1079335b721b56f14f3 | [
"MIT"
] | 1 | 2019-09-20T09:04:27.000Z | 2019-09-20T09:04:27.000Z | picture/migrations/0001_initial.py | Michellemukami/django-image | 754a4b0ce32415383f99f1079335b721b56f14f3 | [
"MIT"
] | 4 | 2020-06-05T22:35:14.000Z | 2021-06-10T21:52:40.000Z | picture/migrations/0001_initial.py | Michellemukami/django-image | 754a4b0ce32415383f99f1079335b721b56f14f3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-08-22 09:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Create... | 33.846154 | 114 | 0.568182 |
91b9ee7f07e53019ee0d1593c8ee8751228ee83e | 17,384 | py | Python | localstack/services/s3/s3_utils.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | null | null | null | localstack/services/s3/s3_utils.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | null | null | null | localstack/services/s3/s3_utils.py | matt-mercer/localstack | b69ba25e495c6ef889d33a050b216d0cd1035041 | [
"Apache-2.0"
] | null | null | null | import datetime
import logging
import re
import time
from collections import namedtuple
from typing import Dict
from urllib import parse as urlparse
from urllib.parse import parse_qs, urlencode
from botocore.awsrequest import create_request_object
from botocore.compat import urlsplit
from botocore.credentials import C... | 37.956332 | 119 | 0.657041 |
c24d32c700fd4035542a928073200c021eb085fc | 1,860 | py | Python | wb/main/models/tokenizer/validate_tokenizer_jobs_model.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 23 | 2022-03-17T12:24:09.000Z | 2022-03-31T09:13:30.000Z | wb/main/models/tokenizer/validate_tokenizer_jobs_model.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 18 | 2022-03-21T08:17:44.000Z | 2022-03-30T12:42:30.000Z | wb/main/models/tokenizer/validate_tokenizer_jobs_model.py | apaniukov/workbench | 2f2653ecfd0143d2d53e33ad84379f13443fdfaa | [
"Apache-2.0"
] | 16 | 2022-03-17T12:24:14.000Z | 2022-03-31T12:15:12.000Z | """
OpenVINO DL Workbench
Validate tokenizer upload job model
Copyright (c) 2021 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... | 34.444444 | 92 | 0.73871 |
fd6cd5694a3eccc73a1b9b892437e62dee36fc03 | 634 | py | Python | 4949/solution.py | bossm0n5t3r/BOJ | 03132388a0c76ef66d6b0dec2053aeca65c4aee6 | [
"MIT"
] | 2 | 2020-01-14T07:27:25.000Z | 2020-02-12T07:49:58.000Z | 4949/solution.py | bossm0n5t3r/BOJ | 03132388a0c76ef66d6b0dec2053aeca65c4aee6 | [
"MIT"
] | 1 | 2020-01-14T07:29:30.000Z | 2021-11-28T11:29:08.000Z | 4949/solution.py | bossm0n5t3r/BOJ | 03132388a0c76ef66d6b0dec2053aeca65c4aee6 | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
print = sys.stdout.writelines
def sol():
while True:
input_str = input().rstrip()
if input_str == ".":
break
print("yes\n" if is_valid(input_str) else "no\n")
def is_valid(S):
stack = []
for c in S:
if c in "([":
... | 19.212121 | 57 | 0.463722 |
c24a0157c2eedcb21eeab2ed47ea7269675dcd83 | 25,136 | py | Python | Sindri/eos.py | mrcsbrn/TCC_software | 17a5335aed17d4740c3bbd0ef828b0fc5dcea1da | [
"MIT"
] | 11 | 2019-10-17T02:01:51.000Z | 2022-03-17T17:39:34.000Z | Sindri/eos.py | mrcsbrn/TCC_software | 17a5335aed17d4740c3bbd0ef828b0fc5dcea1da | [
"MIT"
] | 2 | 2019-07-25T22:16:16.000Z | 2020-03-28T01:59:59.000Z | Sindri/eos.py | mrcsbrn/TCC_software | 17a5335aed17d4740c3bbd0ef828b0fc5dcea1da | [
"MIT"
] | 5 | 2019-07-15T18:19:36.000Z | 2021-12-24T08:06:24.000Z | import numpy as np
import sympy as sp
from scipy.integrate import quad
from CubicEOS import CubicEOS
from Properties import Props
from compounds import MixtureProp
from constants import R_IG
from polyEqSolver import solve_cubic
eos_options = {
"van der Waals (1890)": "van_der_waals_1890",
"Redlich and Kwong (... | 36.21902 | 99 | 0.416852 |
b4ebdcf097c1c77b913aaa12ba09ee487d40c9c0 | 1,234 | py | Python | imps/tests/test_strings.py | bootandy/imps | 21c84b788d44a296d8db4f655bedcef3fad12c36 | [
"Apache-2.0"
] | 13 | 2017-07-11T18:43:32.000Z | 2020-12-29T23:13:12.000Z | imps/tests/test_strings.py | bootandy/imps | 21c84b788d44a296d8db4f655bedcef3fad12c36 | [
"Apache-2.0"
] | 4 | 2018-06-15T09:33:11.000Z | 2019-02-09T10:46:56.000Z | imps/tests/test_strings.py | bootandy/imps | 21c84b788d44a296d8db4f655bedcef3fad12c36 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division, print_function
from imps.strings import get_doc_string, TRIPLE_DOUBLE, TRIPLE_SINGLE
def test_doc_string_ignores_normal_line():
s = 'import A'
assert not get_doc_string(s)
def test_doc_string_ignores_doc_string_in_comment():
s = 'import A # triple comm... | 27.422222 | 74 | 0.648298 |
96258328ea70d922520f48c5455590338cd82c38 | 1,891 | py | Python | python/models/models.py | thejoeejoee/UPA-MIT-VUT-2020-2021 | 578ac0ec057b23d71792bab9df34e0bc143aabd3 | [
"MIT"
] | null | null | null | python/models/models.py | thejoeejoee/UPA-MIT-VUT-2020-2021 | 578ac0ec057b23d71792bab9df34e0bc143aabd3 | [
"MIT"
] | 5 | 2021-04-08T20:36:28.000Z | 2021-09-22T19:39:33.000Z | python/models/models.py | thejoeejoee/UPA-MIT-VUT-2020-2021 | 578ac0ec057b23d71792bab9df34e0bc143aabd3 | [
"MIT"
] | 1 | 2021-09-08T10:23:34.000Z | 2021-09-08T10:23:34.000Z | from django.db import models
from django_extensions.db.fields import CreationDateTimeField
from bulk_update_or_create import BulkUpdateOrCreateQuerySet
class BaseModel(models.Model):
created = CreationDateTimeField()
objects = models.Manager()
bulk_objects = BulkUpdateOrCreateQuerySet.as_manager()
c... | 28.223881 | 111 | 0.692226 |
70973f51b568a08fabc51bd4468332ab6037c1b7 | 2,636 | py | Python | apps/applications/urls.py | SkyAdam1/zayed | 340d7462fb1e37c60b2a03c6a05b15870f0cb8b8 | [
"Apache-2.0"
] | 1 | 2021-04-12T16:40:01.000Z | 2021-04-12T16:40:01.000Z | apps/applications/urls.py | SkyAdam1/zayed | 340d7462fb1e37c60b2a03c6a05b15870f0cb8b8 | [
"Apache-2.0"
] | null | null | null | apps/applications/urls.py | SkyAdam1/zayed | 340d7462fb1e37c60b2a03c6a05b15870f0cb8b8 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index_url"),
path(
"application_edit/<slug:pk>",
views.ApplicationUpdateView.as_view(),
name="application_update_url",
),
path(
"applications/",
views.ApplicationsOutput... | 28.967033 | 88 | 0.615706 |
df4435720b7d9f192a28bcc7d6394770614a726c | 966 | py | Python | examples/real-world-data/superconduct/final_explainer.py | veneres/gef | 07912d01040ca0169977ddd49839050c81ec2349 | [
"MIT"
] | 2 | 2022-02-16T08:02:15.000Z | 2022-02-16T13:07:53.000Z | examples/real-world-data/superconduct/final_explainer.py | veneres/gef | 07912d01040ca0169977ddd49839050c81ec2349 | [
"MIT"
] | null | null | null | examples/real-world-data/superconduct/final_explainer.py | veneres/gef | 07912d01040ca0169977ddd49839050c81ec2349 | [
"MIT"
] | null | null | null | import json
import pickle
from gamexplainer import GamExplainer
import lightgbm as lgbm
def main():
with open("config.json") as f:
config_dict = json.load(f)
model_path = config_dict["model_path"]
explainer_out = config_dict["explainer_out"]
forest = lgbm.Booster(model_file=model_pat... | 25.421053 | 54 | 0.634576 |
28afe335eaab9c196e4343902c35f1096904511d | 710 | py | Python | chat/forms.py | BastaAditya/Quiver | a6d29ec67341bd9cdb8a193ce1efcfd699aa4a96 | [
"MIT"
] | null | null | null | chat/forms.py | BastaAditya/Quiver | a6d29ec67341bd9cdb8a193ce1efcfd699aa4a96 | [
"MIT"
] | null | null | null | chat/forms.py | BastaAditya/Quiver | a6d29ec67341bd9cdb8a193ce1efcfd699aa4a96 | [
"MIT"
] | null | null | null | from django import forms
from .models import ChatMessage, ChatInfo
from loginsignup.utils import getBeaverInstanceFromUser
class ChatMessageForm(forms.ModelForm):
class Meta:
model = ChatMessage
fields = ["message","reply"]
def createNewMessage(self, urlparam, user):
status = super().... | 33.809524 | 82 | 0.690141 |
a5cf07b9a375bd60143ba9a28f414f1d5f0873ec | 4,270 | py | Python | src/queue/python/queue.py | SamyuelDanyo/data-structures | 057fbebd5f4be3af81727c09970f843df7c43007 | [
"MIT"
] | null | null | null | src/queue/python/queue.py | SamyuelDanyo/data-structures | 057fbebd5f4be3af81727c09970f843df7c43007 | [
"MIT"
] | null | null | null | src/queue/python/queue.py | SamyuelDanyo/data-structures | 057fbebd5f4be3af81727c09970f843df7c43007 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#################################################
""" queue.py
# # Queue(FIFO) Implementation
# Supports:
# - Push.
# - Pop.
# - Peek.
"""
#################################################
# ### Author: Samyuel Danyo
# ### Date: 02/06/2020
# ### Last Edit: 02/06/2020
##########... | 27.197452 | 58 | 0.479859 |
9184b423b8d4e2b3fefb3620464ef3096d327287 | 1,533 | py | Python | packages/sklearn/_bak/pre/svm/nodes/svm___LinearSVCGetParams0/svm___LinearSVCGetParams0___METACODE.py | frecklebars/Ryven | 86a8c06effc47897d0b8fbbd1fa8580a957f9515 | [
"MIT"
] | 18 | 2021-01-18T09:52:41.000Z | 2022-03-22T10:48:44.000Z | packages/sklearn/_bak/svm/nodes/svm___LinearSVCGetParams0/svm___LinearSVCGetParams0___METACODE.py | frecklebars/Ryven | 86a8c06effc47897d0b8fbbd1fa8580a957f9515 | [
"MIT"
] | null | null | null | packages/sklearn/_bak/svm/nodes/svm___LinearSVCGetParams0/svm___LinearSVCGetParams0___METACODE.py | frecklebars/Ryven | 86a8c06effc47897d0b8fbbd1fa8580a957f9515 | [
"MIT"
] | 3 | 2021-01-18T09:49:42.000Z | 2022-03-22T10:48:47.000Z | from NIENV import *
# API METHODS --------------
# self.main_widget
# self.update_shape()
# Ports
# self.input(index)
# self.set_output_val(index, val)
# self.exec_output(index)
# self.create_new_input(type_, label, widget_name=None, widget_pos='under', pos=-1)
# self.delete_input(index)
# self.create_new_output(t... | 25.55 | 83 | 0.593607 |
c7dd45ec3f83ed5c34766e70823e0ad6b43c4d9d | 260 | py | Python | python/mathematics/palindrom.py | jtpio/algo-toolbox | d0f675889889ad52d853d948b0191bbd14c1e9cd | [
"MIT"
] | null | null | null | python/mathematics/palindrom.py | jtpio/algo-toolbox | d0f675889889ad52d853d948b0191bbd14c1e9cd | [
"MIT"
] | null | null | null | python/mathematics/palindrom.py | jtpio/algo-toolbox | d0f675889889ad52d853d948b0191bbd14c1e9cd | [
"MIT"
] | null | null | null | def is_palindrom(c):
""" Return True if the string <c> is a palindrom """
c = str(c)
for i, e in enumerate(c):
if i > len(c)/2:
break
else:
if e != c[len(c)-i-1]:
return False
return True
| 23.636364 | 56 | 0.461538 |
c5631196824a44b488ff0040725cbfe50337ee4b | 391 | py | Python | pollers/pollers/wsgi.py | Hichem-Chabou/Pollers | 9ece8b3680c674637cd28eaa95b5177941699a95 | [
"MIT"
] | null | null | null | pollers/pollers/wsgi.py | Hichem-Chabou/Pollers | 9ece8b3680c674637cd28eaa95b5177941699a95 | [
"MIT"
] | null | null | null | pollers/pollers/wsgi.py | Hichem-Chabou/Pollers | 9ece8b3680c674637cd28eaa95b5177941699a95 | [
"MIT"
] | null | null | null | """
WSGI config for pollers project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
5977ea7857737af516cf73bd0ce9bc3ee968cf6d | 1,206 | py | Python | migration/migrator/migrations/course/20210527091235_remove_lock_date.py | jportorreal00/Submitty | c32256472e9cfaac7c13a3b07a558314eff447af | [
"BSD-3-Clause"
] | 411 | 2016-06-14T20:52:25.000Z | 2022-03-31T21:20:25.000Z | migration/migrator/migrations/course/20210527091235_remove_lock_date.py | KaelanWillauer/Submitty | cf9b6ceda15ec0a661e2ca81ea7864790094c64a | [
"BSD-3-Clause"
] | 5,730 | 2016-05-23T21:04:32.000Z | 2022-03-31T10:08:06.000Z | migration/migrator/migrations/course/20210527091235_remove_lock_date.py | KaelanWillauer/Submitty | cf9b6ceda15ec0a661e2ca81ea7864790094c64a | [
"BSD-3-Clause"
] | 423 | 2016-09-22T21:11:30.000Z | 2022-03-29T18:55:28.000Z | """Migration for a given Submitty course database."""
def up(config, database, semester, course):
"""
Run up migration.
:param config: Object holding configuration details about Submitty
:type config: migrator.config.Config
:param database: Object for interacting with given database for environme... | 35.470588 | 103 | 0.730514 |
0c0401a2f9d37ebea7ef0dc79eeb96f2a8bccbc0 | 6,070 | py | Python | nixpkgs_review/report.py | omasanori/nixpkgs-review | 868eced5bc552c6f3756af9142263a1b6fe64d2c | [
"MIT"
] | 57 | 2018-03-17T17:32:37.000Z | 2019-12-04T18:22:07.000Z | nixpkgs_review/report.py | omasanori/nixpkgs-review | 868eced5bc552c6f3756af9142263a1b6fe64d2c | [
"MIT"
] | 33 | 2018-04-22T01:26:30.000Z | 2019-12-05T15:51:28.000Z | nixpkgs_review/report.py | omasanori/nixpkgs-review | 868eced5bc552c6f3756af9142263a1b6fe64d2c | [
"MIT"
] | 11 | 2018-05-28T10:35:19.000Z | 2019-11-04T10:29:05.000Z | import os
import subprocess
import json
from pathlib import Path
from typing import Callable, List, Optional
from .nix import Attr
from .utils import info, link, warn
def print_number(
packages: List[Attr],
msg: str,
what: str = "package",
log: Callable[[str], None] = warn,
) -> None:
if len(pack... | 34.101124 | 102 | 0.547776 |
12a75abc60dcb8a5b09cc139bf9706ead05905ab | 1,830 | py | Python | setup.py | neogeo-technologies/idgo | 23e028b0d7fb2daf54d7e2954e0cc4d7b9be4210 | [
"Apache-2.0"
] | null | null | null | setup.py | neogeo-technologies/idgo | 23e028b0d7fb2daf54d7e2954e0cc4d7b9be4210 | [
"Apache-2.0"
] | 2 | 2018-09-14T07:12:00.000Z | 2019-11-13T09:32:24.000Z | setup.py | neogeo-technologies/idgo | 23e028b0d7fb2daf54d7e2954e0cc4d7b9be4210 | [
"Apache-2.0"
] | 2 | 2019-03-25T08:27:43.000Z | 2019-10-07T15:25:30.000Z | # Copyright (c) 2017-2021 Neogeo-Technologies.
# 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... | 31.551724 | 76 | 0.688525 |
86861d30214a43a95192d0f179be6ba705e002c8 | 1,737 | py | Python | colossalai/nn/layer/colossalai_layer/normalization.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 1,630 | 2021-10-30T01:00:27.000Z | 2022-03-31T23:02:41.000Z | colossalai/nn/layer/colossalai_layer/normalization.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 166 | 2021-10-30T01:03:01.000Z | 2022-03-31T14:19:07.000Z | colossalai/nn/layer/colossalai_layer/normalization.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 253 | 2021-10-30T06:10:29.000Z | 2022-03-31T13:30:06.000Z | from colossalai.utils import get_current_device
from torch import nn
from ..parallel_1d import LayerNorm1D
from ..parallel_2d import LayerNorm2D
from ..parallel_2p5d import LayerNorm2p5D
from ..parallel_3d import LayerNorm3D
from ..utils import get_tensor_parallel_mode
from ..vanilla import VanillaLayerNorm
f... | 41.357143 | 98 | 0.686241 |
3cbf1c52d1686baf3ec07901e69e4875f758b6be | 15,880 | py | Python | ivy/compiler/op_logging.py | ashok-arjun/ivy | 274c03f667cda10e09b75e90e7a3a46b358e0358 | [
"Apache-2.0"
] | 161 | 2021-01-20T22:11:13.000Z | 2022-01-09T09:46:33.000Z | ivy/compiler/op_logging.py | ashok-arjun/ivy | 274c03f667cda10e09b75e90e7a3a46b358e0358 | [
"Apache-2.0"
] | 4 | 2021-11-10T17:04:36.000Z | 2021-11-26T06:40:43.000Z | ivy/compiler/op_logging.py | ashok-arjun/ivy | 274c03f667cda10e09b75e90e7a3a46b358e0358 | [
"Apache-2.0"
] | 8 | 2021-02-17T20:56:33.000Z | 2022-01-09T16:45:40.000Z | # global
import ivy
import time
import weakref
import inspect
import importlib
# local
from ivy.compiler import globals as glob
# noinspection PyProtectedMember
from ivy.compiler.helpers import _get_unique_id, _get_shape, _get_fn_signature, _clone_param, _delete_dependent_param,\
_args_n_kwarg_reprs_from_keys_n_ar... | 47.831325 | 123 | 0.666373 |
4d4e3b72de39d6424d156730caa005eebf947ffa | 587,680 | py | Python | juju/client/_client2.py | tai271828/python-libjuju | af10ed0a60a6ab2d93ad329e208832f49d164952 | [
"Apache-2.0"
] | null | null | null | juju/client/_client2.py | tai271828/python-libjuju | af10ed0a60a6ab2d93ad329e208832f49d164952 | [
"Apache-2.0"
] | null | null | null | juju/client/_client2.py | tai271828/python-libjuju | af10ed0a60a6ab2d93ad329e208832f49d164952 | [
"Apache-2.0"
] | null | null | null | # DO NOT CHANGE THIS FILE! This file is auto-generated by facade.py.
# Changes will be overwritten/lost when the file is regenerated.
from juju.client.facade import Type, ReturnMapping
from juju.client._definitions import *
class ActionFacade(Type):
name = 'Action'
version = 2
schema = {'definitions'... | 55.227892 | 309 | 0.3673 |
7354451ae75cb5f78069db39dec6d86d7f0c67a5 | 1,940 | py | Python | disentanglement_lib/methods/shared/optimizers.py | travers-rhodes/disentanglement_lib | 73d4b995e88efdd5ffbe98a72e48a620c58f4dc7 | [
"Apache-2.0"
] | 1,280 | 2019-02-09T20:27:37.000Z | 2022-03-29T18:02:23.000Z | disentanglement_lib/methods/shared/optimizers.py | travers-rhodes/disentanglement_lib | 73d4b995e88efdd5ffbe98a72e48a620c58f4dc7 | [
"Apache-2.0"
] | 34 | 2019-02-14T23:18:01.000Z | 2021-11-23T00:55:54.000Z | disentanglement_lib/methods/shared/optimizers.py | travers-rhodes/disentanglement_lib | 73d4b995e88efdd5ffbe98a72e48a620c58f4dc7 | [
"Apache-2.0"
] | 199 | 2019-02-13T17:52:00.000Z | 2022-03-11T17:37:26.000Z | # coding=utf-8
# Copyright 2018 The DisentanglementLib 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
#
# Un... | 38.8 | 80 | 0.776804 |
7dd17567fc31ccac2ebeb8c3dfc64c7b4a29a471 | 307 | py | Python | django_referrer_policy/tests/urls.py | adamchainz/django-referrer-policy | 507a83826a4e3f65f05332c72251ebdedd49f5bf | [
"BSD-3-Clause"
] | 33 | 2018-02-12T03:41:09.000Z | 2022-01-07T13:54:03.000Z | django_referrer_policy/tests/urls.py | adamchainz/django-referrer-policy | 507a83826a4e3f65f05332c72251ebdedd49f5bf | [
"BSD-3-Clause"
] | 2 | 2018-07-06T06:07:24.000Z | 2019-08-11T09:02:10.000Z | django_referrer_policy/tests/urls.py | adamchainz/django-referrer-policy | 507a83826a4e3f65f05332c72251ebdedd49f5bf | [
"BSD-3-Clause"
] | 4 | 2018-10-09T23:16:17.000Z | 2019-07-16T12:08:50.000Z | from django.conf.urls import url
from django.http import HttpResponse
def view(request):
"""
A minimal view for use in testing.
"""
return HttpResponse('Content.')
urlpatterns = [
url(r'^referrer-policy-middleware$',
view,
name='test-referrer-policy-middleware'),
]
| 17.055556 | 48 | 0.651466 |
01c071a2f63472929db5d0ba18742f1fc40c29a9 | 3,494 | py | Python | pypureclient/flasharray/FA_2_4/models/time_window.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_4/models/time_window.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_4/models/time_window.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 29.610169 | 169 | 0.544362 |
ccaa6d65ffe8284f14b7293adeca6609fcb17bc5 | 546 | py | Python | gdsfactory/tests/test_serialize.py | simbilod/gdsfactory | 4d76db32674c3edb4d16260e3177ee29ef9ce11d | [
"MIT"
] | null | null | null | gdsfactory/tests/test_serialize.py | simbilod/gdsfactory | 4d76db32674c3edb4d16260e3177ee29ef9ce11d | [
"MIT"
] | null | null | null | gdsfactory/tests/test_serialize.py | simbilod/gdsfactory | 4d76db32674c3edb4d16260e3177ee29ef9ce11d | [
"MIT"
] | null | null | null | import gdsfactory as gf
from gdsfactory.cross_section import strip
@gf.cell
def demo_cross_section_setting(cross_section=strip()) -> gf.Component:
return gf.components.straight(cross_section=cross_section)
def test_settings(data_regression, check: bool = True) -> None:
"""Avoid regressions when exporting se... | 26 | 70 | 0.736264 |
d760a8437b362b7728f0c33bdf1ec9b14c091911 | 1,151 | py | Python | tag_resolver_proxy/resolve_tags/quay_io.py | verygood-ops/kritis-reverse-proxy | 10a635d52132f1e5529cea1f39a3c8ae0fc43ece | [
"MIT"
] | 1 | 2020-06-24T22:20:26.000Z | 2020-06-24T22:20:26.000Z | tag_resolver_proxy/resolve_tags/quay_io.py | verygood-ops/kritis-reverse-proxy | 10a635d52132f1e5529cea1f39a3c8ae0fc43ece | [
"MIT"
] | null | null | null | tag_resolver_proxy/resolve_tags/quay_io.py | verygood-ops/kritis-reverse-proxy | 10a635d52132f1e5529cea1f39a3c8ae0fc43ece | [
"MIT"
] | null | null | null | from tag_resolver_proxy.resolve_tags import base
from tag_resolver_proxy.resolve_tags.base import ImageProperties
def quay_repository_url(organization: str, software: str) -> str:
return f'https://quay.io/api/v1/repository/{organization}/{software}'
class QuayIOTagResolver(base.TagResolver):
registry_base_... | 33.852941 | 100 | 0.681147 |
d5aa03372c63ae3c9691fe8a86796cb596677d96 | 2,300 | py | Python | test/segments_test/hg_test.py | Pl4gue/powerline-shell | ae33f7e7cf48583c7647a3481967aa0dfdb9909e | [
"MIT"
] | null | null | null | test/segments_test/hg_test.py | Pl4gue/powerline-shell | ae33f7e7cf48583c7647a3481967aa0dfdb9909e | [
"MIT"
] | null | null | null | test/segments_test/hg_test.py | Pl4gue/powerline-shell | ae33f7e7cf48583c7647a3481967aa0dfdb9909e | [
"MIT"
] | 1 | 2020-04-19T04:53:34.000Z | 2020-04-19T04:53:34.000Z | import unittest
import mock
import tempfile
import shutil
import sh
import powerline_shell.segments.hg as hg
from powerline_shell.utils import RepoStats
from ..testing_utils import dict_side_effect_fn
test_cases = {
"? new-file": RepoStats(new=1),
"M modified-file": RepoStats(changed=1),
"R removed-file":... | 30.263158 | 76 | 0.655652 |
bc5d5f327c98c6dd5e1b187534509a9bb97f8f22 | 168 | py | Python | examples/core/datasets/__init__.py | zlianghahaha/torchquantum | 685fa5621c0bf24d47d94e37c82ce7fd3c04ef1d | [
"MIT"
] | null | null | null | examples/core/datasets/__init__.py | zlianghahaha/torchquantum | 685fa5621c0bf24d47d94e37c82ce7fd3c04ef1d | [
"MIT"
] | null | null | null | examples/core/datasets/__init__.py | zlianghahaha/torchquantum | 685fa5621c0bf24d47d94e37c82ce7fd3c04ef1d | [
"MIT"
] | null | null | null | from .mnist import *
from .vowel import *
from .layer_regression import *
from .vqe import *
from .cifar10 import *
from .simple2cls import *
from .simple3cls import *
| 21 | 31 | 0.75 |
799e1b69e4fbc5dc0826eb03b938b3d35dab09f9 | 505 | py | Python | tests/test_sentinel.py | PaulRenvoise/flashback | f9a16f4b0cb12a2180206c7b95d9eb8fb256381d | [
"MIT"
] | 3 | 2021-06-08T11:40:59.000Z | 2022-03-31T16:22:56.000Z | tests/test_sentinel.py | PaulRenvoise/flashback | f9a16f4b0cb12a2180206c7b95d9eb8fb256381d | [
"MIT"
] | 28 | 2020-04-28T22:36:14.000Z | 2021-06-06T20:32:00.000Z | tests/test_sentinel.py | PaulRenvoise/flashback | f9a16f4b0cb12a2180206c7b95d9eb8fb256381d | [
"MIT"
] | null | null | null | # pylint: disable=no-self-use
from flashback import Sentinel
class TestSentinel:
def test_instance_equality(self):
sentinel = Sentinel()
assert sentinel == Sentinel()
def test_instance_identity(self):
sentinel = Sentinel()
assert sentinel is Sentinel()
def test_class_e... | 19.423077 | 37 | 0.657426 |
cdf18ccfdbf23f23279f0be7b7c33f771a63001b | 2,465 | py | Python | main/main_edge_ppi.py | khangtran2020/contentDP | d0d83c387f2d21fce342d0c445eb06ec928c1414 | [
"MIT"
] | null | null | null | main/main_edge_ppi.py | khangtran2020/contentDP | d0d83c387f2d21fce342d0c445eb06ec928c1414 | [
"MIT"
] | null | null | null | main/main_edge_ppi.py | khangtran2020/contentDP | d0d83c387f2d21fce342d0c445eb06ec928c1414 | [
"MIT"
] | null | null | null | import os
import warnings
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
os.environ["CUDA_LAUNCH_BLOCKING"] = "1"
warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.filterwarnings("ignore", category=UserWarning)
warnings.simplefilter(action='ignore', categor... | 37.923077 | 132 | 0.752535 |
87358730222eaf6310c6dc341da5b5913bef45ab | 4,236 | py | Python | rprop.py | JoonyoungYi/RProp-tensorflow | cd52ee789136453267762b1e428984af018890e7 | [
"MIT"
] | 9 | 2019-03-11T09:23:54.000Z | 2021-11-25T14:00:34.000Z | rprop.py | JoonyoungYi/RProp-tensorflow | cd52ee789136453267762b1e428984af018890e7 | [
"MIT"
] | null | null | null | rprop.py | JoonyoungYi/RProp-tensorflow | cd52ee789136453267762b1e428984af018890e7 | [
"MIT"
] | null | null | null | """
RProp (Resilient Backpropagation) for TensorFlow.
This code is forked form "https://raw.githubusercontent.com/dirkweissenborn/genie-kb/master/rprop.py".
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.... | 37.486726 | 106 | 0.592304 |
8534c6cacd468b3186aa43814331562690b25f8c | 4,403 | py | Python | taln2016/icsisumm-primary-sys34_v1/eval_taln.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null | taln2016/icsisumm-primary-sys34_v1/eval_taln.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null | taln2016/icsisumm-primary-sys34_v1/eval_taln.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null | import sys, os, os.path, tempfile, re, collections, shutil
rg = 'perl /home/alonso/tool/ROUGE-1.5.5/ROUGE_externalstemmer-1.5.5.pl'
def create_config_duc(model_dir, peer_dir, exper_dir):
models = [item for item in os.listdir(model_dir) if ("sum_" in item and item.endswith("sent.tok")) ]
print models
peers = os.... | 34.944444 | 159 | 0.650238 |
785f9f2099dbff3f3c4905a1dbdf1b2cf89e08fe | 2,535 | py | Python | gbpservice/neutron/services/servicechain/plugins/ncp/exceptions.py | ashutosh-mishra/my-test | 51c82af293f291b9182204392e7d21bda27786d1 | [
"Apache-2.0"
] | null | null | null | gbpservice/neutron/services/servicechain/plugins/ncp/exceptions.py | ashutosh-mishra/my-test | 51c82af293f291b9182204392e7d21bda27786d1 | [
"Apache-2.0"
] | null | null | null | gbpservice/neutron/services/servicechain/plugins/ncp/exceptions.py | ashutosh-mishra/my-test | 51c82af293f291b9182204392e7d21bda27786d1 | [
"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
# d... | 39 | 78 | 0.715582 |
afc44f2cfa648c3668170bab73364079e01636bc | 7,732 | py | Python | app/simulation/Simulation.py | shyamTum/CrowdNav | 93015712f42d6aafc217f3c0362b209134ac5cb1 | [
"MIT"
] | 15 | 2018-04-27T15:39:57.000Z | 2021-05-19T20:58:23.000Z | app/simulation/Simulation.py | shyamTum/CrowdNav | 93015712f42d6aafc217f3c0362b209134ac5cb1 | [
"MIT"
] | null | null | null | app/simulation/Simulation.py | shyamTum/CrowdNav | 93015712f42d6aafc217f3c0362b209134ac5cb1 | [
"MIT"
] | 15 | 2018-02-03T14:45:48.000Z | 2020-04-08T07:25:43.000Z | import json
import traci
import traci.constants as tc
from app.network.Network import Network
from app.streaming import RTXForword
from colorama import Fore
from app import Config
from app.entitiy.CarRegistry import CarRegistry
from app.logging import info
from app.routing.CustomRouter import CustomRouter
from app.st... | 51.205298 | 119 | 0.595318 |
76da22533e0353c71a98b4d2ddfabc69bd8fdef1 | 761 | py | Python | credmaker/openstackrc_maker.py | OneOfaKindGeek/mycode | bbb4391b333aaa1667314b76393f2102c05a2571 | [
"Apache-2.0"
] | null | null | null | credmaker/openstackrc_maker.py | OneOfaKindGeek/mycode | bbb4391b333aaa1667314b76393f2102c05a2571 | [
"Apache-2.0"
] | null | null | null | credmaker/openstackrc_maker.py | OneOfaKindGeek/mycode | bbb4391b333aaa1667314b76393f2102c05a2571 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
outFile = open("admin.rc", "a")
osAUTH = input("What is the OS_AUTH_URL?")
print("export OS_AUTH_URL=" + osAUTH, file=outFile)
print("export OS_IDENTITY_API_VERSION=3", file=outFile)
osPROJ = input("What is the OS_PROJECT_NAME?")
print("export OS_PROJECT_NAME=" + osPROJ, file=outFile)
osPROJDO... | 33.086957 | 65 | 0.750329 |
08ff141a55bed62f1eca5b7da6a3592616e2f057 | 821 | py | Python | backend/benchmark/migrations/0002_systeminfo.py | cccgnit/CryptoBenchmark | a7690b2b4a3d994b1feb900457ea67a0134bcb5e | [
"MIT"
] | null | null | null | backend/benchmark/migrations/0002_systeminfo.py | cccgnit/CryptoBenchmark | a7690b2b4a3d994b1feb900457ea67a0134bcb5e | [
"MIT"
] | null | null | null | backend/benchmark/migrations/0002_systeminfo.py | cccgnit/CryptoBenchmark | a7690b2b4a3d994b1feb900457ea67a0134bcb5e | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-05-14 12:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('benchmark', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='SystemInfo',
fields=[
('... | 32.84 | 114 | 0.582217 |
fe847da75577d9988d1709fe12413d544d3e461a | 3,816 | py | Python | monitor/monitor/middlewares.py | reynierg/websites-monitor | afa67d65f4a3dcef11ef86b068e885689970cdd1 | [
"MIT"
] | null | null | null | monitor/monitor/middlewares.py | reynierg/websites-monitor | afa67d65f4a3dcef11ef86b068e885689970cdd1 | [
"MIT"
] | null | null | null | monitor/monitor/middlewares.py | reynierg/websites-monitor | afa67d65f4a3dcef11ef86b068e885689970cdd1 | [
"MIT"
] | null | null | null | """Define here the models for your spider middleware
See documentation in:
https://docs.scrapy.org/en/latest/topics/spider-middleware.html
"""
# from scrapy import signals
# useful for handling different item types with a single interface
# from itemadapter import is_item, ItemAdapter
# class MonitorSpiderMiddlewa... | 36.342857 | 80 | 0.644654 |
1e4e8b51a5abd3265ea38002cbfe0eb846b1f693 | 9,183 | py | Python | dev-tools/scripts/checkJavadocLinks.py | orenovadia/lucene-solr | e8276e09a197c3458fc49b8a4442fce1c7eea792 | [
"Apache-2.0"
] | 1 | 2021-02-10T18:42:17.000Z | 2021-02-10T18:42:17.000Z | dev-tools/scripts/checkJavadocLinks.py | orenovadia/lucene-solr | e8276e09a197c3458fc49b8a4442fce1c7eea792 | [
"Apache-2.0"
] | 2 | 2020-08-05T04:53:15.000Z | 2020-08-26T08:27:11.000Z | dev-tools/scripts/checkJavadocLinks.py | orenovadia/lucene-solr | e8276e09a197c3458fc49b8a4442fce1c7eea792 | [
"Apache-2.0"
] | 2 | 2021-02-16T21:31:36.000Z | 2021-07-22T13:40:45.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 33.392727 | 158 | 0.579985 |
d4edce09f413417526b0deab21b20da1e2fa97ef | 16,722 | py | Python | richcat/modules/consts/_ext2alias_dic_generator.py | richcat-dev/richcat | 3bb3aba63ca95b7964907d5a4c52312344bd262d | [
"MIT"
] | 3 | 2021-12-14T11:01:44.000Z | 2022-03-30T07:02:29.000Z | richcat/modules/consts/_ext2alias_dic_generator.py | richcat-dev/richcat | 3bb3aba63ca95b7964907d5a4c52312344bd262d | [
"MIT"
] | 110 | 2020-11-22T15:08:05.000Z | 2022-03-29T10:59:39.000Z | richcat/modules/consts/_ext2alias_dic_generator.py | richcat-dev/richcat | 3bb3aba63ca95b7964907d5a4c52312344bd262d | [
"MIT"
] | 1 | 2020-12-20T14:27:32.000Z | 2020-12-20T14:27:32.000Z | """
richcat.modules._ext2alias_dic_generator
----------------------------------------
Dictionary for convert extension to alias.
This file is generated by itself. Every Time you change something on this dictionary, run this script to update it.
"""
import os
import pickle
import subprocess
from pygments.lexers impor... | 23.096685 | 119 | 0.462265 |
8e67599abdf0264d72fe0d6ac4513fcd7f28ac82 | 5,183 | py | Python | src/garage/tf/algos/trpo.py | bainro/garage | c5afbb19524792d9bbad9b9741f45e1d48ddca3d | [
"MIT"
] | null | null | null | src/garage/tf/algos/trpo.py | bainro/garage | c5afbb19524792d9bbad9b9741f45e1d48ddca3d | [
"MIT"
] | null | null | null | src/garage/tf/algos/trpo.py | bainro/garage | c5afbb19524792d9bbad9b9741f45e1d48ddca3d | [
"MIT"
] | null | null | null | """Trust Region Policy Optimization."""
from garage.tf.algos.npo import NPO
from garage.tf.optimizers import ConjugateGradientOptimizer
from garage.tf.optimizers import PenaltyLbfgsOptimizer
class TRPO(NPO):
"""Trust Region Policy Optimization.
See https://arxiv.org/abs/1502.05477.
Args:
env_spe... | 45.069565 | 78 | 0.582867 |
a25f9decd7290a83210b126e034fea662276d252 | 23,425 | py | Python | vnpy/gateway/ctptest/ctptest_gateway.py | JonnyORZ/vnpy | c3bb624d95625412a2dd593326abf3833321d2e2 | [
"MIT"
] | 11 | 2019-11-18T06:07:16.000Z | 2020-10-12T11:36:21.000Z | vnpy/gateway/ctptest/ctptest_gateway.py | dovnekai/vnpy | 222475fdf97f77f60cec4ecee231f1b85f44df21 | [
"MIT"
] | 2 | 2019-07-17T09:39:34.000Z | 2019-10-19T16:21:55.000Z | vnpy/gateway/ctptest/ctptest_gateway.py | dovnekai/vnpy | 222475fdf97f77f60cec4ecee231f1b85f44df21 | [
"MIT"
] | 6 | 2019-10-30T14:52:21.000Z | 2021-01-11T05:41:17.000Z | """
"""
from datetime import datetime
from .vnctpmd import MdApi
from .vnctptd import TdApi
from .ctp_constant import (
THOST_FTDC_OAS_Submitted,
THOST_FTDC_OAS_Accepted,
THOST_FTDC_OAS_Rejected,
THOST_FTDC_OST_NoTradeQueueing,
THOST_FTDC_OST_PartTradedQueueing,
THOST_FTDC_OST_AllTraded,
T... | 29.171856 | 99 | 0.584418 |
197429d502191499946724c2e4c3f0d7128b4d7e | 844 | py | Python | tests/utils/test_date.py | szilvajuhos/scout | 2f4a03fb3192a57c99fd62be626e8c22051e81af | [
"BSD-3-Clause"
] | 1 | 2019-08-17T21:20:04.000Z | 2019-08-17T21:20:04.000Z | tests/utils/test_date.py | szilvajuhos/scout | 2f4a03fb3192a57c99fd62be626e8c22051e81af | [
"BSD-3-Clause"
] | null | null | null | tests/utils/test_date.py | szilvajuhos/scout | 2f4a03fb3192a57c99fd62be626e8c22051e81af | [
"BSD-3-Clause"
] | null | null | null | import datetime
import pytest
from scout.utils.date import (match_date, get_date)
def test_match_date_dash():
date_str = "2015-05-10"
assert match_date(date_str)
def test_match_date_dot():
date_str = "2015.05.10"
assert match_date(date_str)
def test_match_invalid_date():
date_str = "20150510"
... | 24.114286 | 51 | 0.727488 |
f3bd92c097acd7ade5514a6a41068518db3bc954 | 1,885 | py | Python | aceql/progress_indicator.py | GuillaumeR77/aceql-http-client-python | a7f46cf2f72095d41ce4d946e2e55e6a4007f79e | [
"Apache-2.0"
] | null | null | null | aceql/progress_indicator.py | GuillaumeR77/aceql-http-client-python | a7f46cf2f72095d41ce4d946e2e55e6a4007f79e | [
"Apache-2.0"
] | null | null | null | aceql/progress_indicator.py | GuillaumeR77/aceql-http-client-python | a7f46cf2f72095d41ce4d946e2e55e6a4007f79e | [
"Apache-2.0"
] | null | null | null | #
# This file is part of AceQL Python Client SDK.
# AceQL Python Client SDK: Remote SQL access over HTTP with AceQL HTTP.
# Copyright (C) 2021, KawanSoft SAS
# (http://www.kawansoft.com). All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in comp... | 31.416667 | 93 | 0.67321 |
55cebc01d60cf9af3639dedbf4114becac66c5a6 | 1,932 | py | Python | test/test_local_worker.py | Rishav1/PySyft | f620ee12727b52b19a317f263789830b57ee2539 | [
"Apache-2.0"
] | 2 | 2020-12-30T11:21:43.000Z | 2021-12-04T16:25:53.000Z | test/test_local_worker.py | Rishav1/PySyft | f620ee12727b52b19a317f263789830b57ee2539 | [
"Apache-2.0"
] | 3 | 2019-05-24T01:16:56.000Z | 2019-09-18T13:02:30.000Z | test/test_local_worker.py | Rishav1/PySyft | f620ee12727b52b19a317f263789830b57ee2539 | [
"Apache-2.0"
] | 1 | 2022-03-12T08:04:34.000Z | 2022-03-12T08:04:34.000Z | import syft as sy
import torch as th
def test_client_worker_does_not_register_object(hook):
me = hook.local_worker
me.is_client_worker = True
x = th.tensor([1, 2, 3])
assert x.id not in me._objects
def test_object_registration(hook):
me = hook.local_worker
me.is_client_worker = False
x =... | 25.76 | 87 | 0.686335 |
0c3ff6035b856daaeb72333b42682dfb02fa959a | 21,318 | py | Python | myven/lib/python3.8/site-packages/ansible/modules/network/f5/bigip_monitor_snmp_dca.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | myven/lib/python3.8/site-packages/ansible/modules/network/f5/bigip_monitor_snmp_dca.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | null | null | null | myven/lib/python3.8/site-packages/ansible/modules/network/f5/bigip_monitor_snmp_dca.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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 = {'metadata_version': '1.1',
... | 32.398176 | 92 | 0.63627 |
3cdbd5c02977f1ff36035a2c0a26292f63896401 | 16,190 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_wanopt_profile_tcp.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_wanopt_profile_tcp.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_wanopt_profile_tcp.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
# Copyright 2019-2021 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... | 34.520256 | 160 | 0.455405 |
d2012e25b3471e6125d0168663b2ce10662b859c | 2,038 | py | Python | data.py | rodoufu/btc-rawtx-rest | 0a53e32eb16217112e0ed4f5e43b345157378acb | [
"MIT"
] | 3 | 2020-03-20T10:01:37.000Z | 2021-09-27T20:40:22.000Z | data.py | rodoufu/btc-rawtx-rest | 0a53e32eb16217112e0ed4f5e43b345157378acb | [
"MIT"
] | null | null | null | data.py | rodoufu/btc-rawtx-rest | 0a53e32eb16217112e0ed4f5e43b345157378acb | [
"MIT"
] | null | null | null | import json
class TransactionInput(object):
"""
Transaction input for the service.
"""
def __init__(self, source_address: str, outputs: dict, fee_kb: int):
self.source_address = source_address
self.outputs = outputs
self.fee_kb = fee_kb
def __str__(self):
return json.dumps(self, default=lambda o: o.__d... | 22.898876 | 89 | 0.713445 |
e2698b17817d610a8e8e8b1357ce58d5346277a2 | 31,171 | py | Python | virtual/lib/python3.8/site-packages/sqlalchemy/dialects/firebird/base.py | Esther-Anyona/mylearner | d49d1c4c8dbeb93cc384f2037c48236be5dc89e1 | [
"MIT"
] | 4 | 2022-02-06T00:54:58.000Z | 2022-02-25T12:44:43.000Z | virtual/lib/python3.8/site-packages/sqlalchemy/dialects/firebird/base.py | Esther-Anyona/mylearner | d49d1c4c8dbeb93cc384f2037c48236be5dc89e1 | [
"MIT"
] | 1 | 2022-03-12T06:00:21.000Z | 2022-03-12T07:07:55.000Z | virtual/lib/python3.8/site-packages/sqlalchemy/dialects/firebird/base.py | Esther-Anyona/mylearner | d49d1c4c8dbeb93cc384f2037c48236be5dc89e1 | [
"MIT"
] | 1 | 2022-02-08T13:43:20.000Z | 2022-02-08T13:43:20.000Z | # firebird/base.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: firebird
:name: Firebird
.. note::
The Firebird diale... | 31.485859 | 79 | 0.57345 |
9ec49575a529f5eb12fc57d8403b5cd070780ae7 | 6,721 | py | Python | lda2vec/utils.py | annaelvira24/Lda2vec-Tensorflow | 57aa112db5f7fed6542e22f91632cae3e98e46ef | [
"MIT"
] | null | null | null | lda2vec/utils.py | annaelvira24/Lda2vec-Tensorflow | 57aa112db5f7fed6542e22f91632cae3e98e46ef | [
"MIT"
] | null | null | null | lda2vec/utils.py | annaelvira24/Lda2vec-Tensorflow | 57aa112db5f7fed6542e22f91632cae3e98e46ef | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.utils import shuffle
import pickle
import pyLDAvis
import os
import random
def _softmax(x):
e_x = np.exp(x - np.max(x))
out = e_x / e_x.sum()
return out
def _softmax_2d(x):
y = x - x.max(axis=1, keepdims=True)
np.exp(y, out=y)
y /= y.sum(axi... | 35.941176 | 119 | 0.666567 |
6bd078989a106bd4a40166b0648737e876a49898 | 30,084 | py | Python | flameview.py | orenbenkiki/flameview | 70a04da078381ab60f1d138ff6fb985b8540d80d | [
"MIT"
] | 13 | 2018-11-03T14:48:41.000Z | 2020-05-18T09:05:12.000Z | flameview.py | orenbenkiki/flameview | 70a04da078381ab60f1d138ff6fb985b8540d80d | [
"MIT"
] | null | null | null | flameview.py | orenbenkiki/flameview | 70a04da078381ab60f1d138ff6fb985b8540d80d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Generate a flame graph view.
"""
import re
import sys
from argparse import ArgumentParser
from argparse import Namespace
from argparse import RawDescriptionHelpFormatter
from random import random
from random import seed
from textwrap import dedent
from typing import Any
from typing import C... | 29.350244 | 100 | 0.610989 |
bf240d4b1e3780d0c71a0499a018a4efb2596e2c | 6,553 | py | Python | Widen/LC123_Best_Time_to_Buy_and_Sell_Stock_III.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | Widen/LC123_Best_Time_to_Buy_and_Sell_Stock_III.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | Widen/LC123_Best_Time_to_Buy_and_Sell_Stock_III.py | crazywiden/Leetcode_daily_submit | 15637e260ab547022ac0c828dd196337bd8d50a3 | [
"MIT"
] | null | null | null | """
LC123. Best Time to Buy and Sell Stock III
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note: You may not engage in multiple transactions at the same time (i.e., you must sell the ... | 37.878613 | 134 | 0.551198 |
c2dd068f5530e690bc2d90249c0be7009f86c8a9 | 5,211 | py | Python | utils/swift_build_support/swift_build_support/targets.py | adrian-prantl/swift | 4cee546841b6f5cf87b3df60efdeaf6bc7b59036 | [
"Apache-2.0"
] | null | null | null | utils/swift_build_support/swift_build_support/targets.py | adrian-prantl/swift | 4cee546841b6f5cf87b3df60efdeaf6bc7b59036 | [
"Apache-2.0"
] | null | null | null | utils/swift_build_support/swift_build_support/targets.py | adrian-prantl/swift | 4cee546841b6f5cf87b3df60efdeaf6bc7b59036 | [
"Apache-2.0"
] | null | null | null | # swift_build_support/targets.py - Build target helpers -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for lic... | 32.981013 | 77 | 0.618691 |
49c69baaed5416cdfed4771994d0617e7b9de16c | 41,856 | py | Python | cinder/tests/unit/image/test_glance.py | alexisries/openstack-cinder | 7cc6e45c5ddb8bf771bdb01b867628e41761ae11 | [
"Apache-2.0"
] | 2 | 2019-05-24T14:13:50.000Z | 2019-05-24T14:21:13.000Z | cinder/tests/unit/image/test_glance.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/image/test_glance.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
# 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... | 39.486792 | 79 | 0.567876 |
2263e16072e8d5d4ffc97cfeaffbc88e0583039d | 2,128 | py | Python | pypd/models/service.py | pmgrafe/pagerduty-api-python-client | f420b34ca9b29689cc2ecc9adca6dc5d56ae7161 | [
"MIT"
] | 88 | 2016-07-26T04:51:18.000Z | 2021-09-12T04:50:18.000Z | pypd/models/service.py | pmgrafe/pagerduty-api-python-client | f420b34ca9b29689cc2ecc9adca6dc5d56ae7161 | [
"MIT"
] | 57 | 2016-07-26T13:21:23.000Z | 2020-06-23T18:22:24.000Z | pypd/models/service.py | pmgrafe/pagerduty-api-python-client | f420b34ca9b29689cc2ecc9adca6dc5d56ae7161 | [
"MIT"
] | 80 | 2016-06-02T18:29:12.000Z | 2020-06-21T08:35:28.000Z | # Copyright (c) PagerDuty.
# See LICENSE for details.
from .entity import Entity
from .integration import Integration
from .vendor import Vendor
class Service(Entity):
"""PagerDuty service entity."""
STR_OUTPUT_FIELDS = ('id', 'name',)
integrationFactory = Integration
vendorFactory = Vendor
ALLO... | 30.84058 | 87 | 0.643327 |
98c5f5782a090e3f42f1e15515953e26a4cd7269 | 17,669 | py | Python | src/ros_robodk_post_processors/robodk_post_processors/HIWIN_HRSS.py | jeritgeorge/ros_robodk_post_processors | dd6fda231c5bcf964bf177b1737dc4b06c27cd33 | [
"BSD-3-Clause"
] | null | null | null | src/ros_robodk_post_processors/robodk_post_processors/HIWIN_HRSS.py | jeritgeorge/ros_robodk_post_processors | dd6fda231c5bcf964bf177b1737dc4b06c27cd33 | [
"BSD-3-Clause"
] | null | null | null | src/ros_robodk_post_processors/robodk_post_processors/HIWIN_HRSS.py | jeritgeorge/ros_robodk_post_processors | dd6fda231c5bcf964bf177b1737dc4b06c27cd33 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 - RoboDK Software S.L. - http://www.robodk.com/
# 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... | 40.618391 | 201 | 0.56019 |
0ee485d8950d74bd2e6c6c9513be99e03cec477f | 2,944 | py | Python | gen_wordcloud.py | gchers/paper-analyser | 738783eb1e6f4a3d1ac013dc7da57027ca4b9b9e | [
"MIT"
] | 14 | 2020-12-26T22:00:22.000Z | 2021-11-08T11:32:29.000Z | gen_wordcloud.py | gchers/paper-analyser | 738783eb1e6f4a3d1ac013dc7da57027ca4b9b9e | [
"MIT"
] | 6 | 2021-03-12T19:36:52.000Z | 2021-05-18T10:39:06.000Z | gen_wordcloud.py | gchers/paper-analyser | 738783eb1e6f4a3d1ac013dc7da57027ca4b9b9e | [
"MIT"
] | 2 | 2020-12-26T22:00:17.000Z | 2021-03-19T12:14:55.000Z | import os
import sys
from wordcloud import WordCloud
if len(sys.argv) != 2:
print("usage: python pq_gen_wordcloud.py TEXTFILE")
exit(0)
whole_text = None
#with open("copy-total-words", "r") as i_f:
with open(sys.argv[1], "r") as i_f:
whole_text = i_f.read()
whole_text = whole_text.replace("cid:", "")
#w... | 33.078652 | 752 | 0.611753 |
9b5291e07b4c739719122f071e9e82eaf7f00019 | 84 | py | Python | ufile/__init__.py | delexxie/ufile-sdk-python | 276864fc865b44f44129b8f42016987c3b084bf6 | [
"MIT"
] | null | null | null | ufile/__init__.py | delexxie/ufile-sdk-python | 276864fc865b44f44129b8f42016987c3b084bf6 | [
"MIT"
] | null | null | null | ufile/__init__.py | delexxie/ufile-sdk-python | 276864fc865b44f44129b8f42016987c3b084bf6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
UCloud UFile SDK for python
"""
__version__ = '3.0.1'
| 10.5 | 27 | 0.559524 |
35c63460571a5936d11a35fd0445b560d9f2c93e | 3,550 | py | Python | bindings/python/ensmallen/datasets/string/megasphaeraspbv3c161.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/megasphaeraspbv3c161.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/megasphaeraspbv3c161.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Megasphaera sp. BV3C161.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protei... | 32.87037 | 223 | 0.676056 |
c44b6e04afadf75dacf2afd754d87484518bceb0 | 1,105 | py | Python | translate.py | ivan-mihailov/german_pdfs_ocr_project | 5a3e6122edf9786fefdf5b7458d7f8bb4dbc891f | [
"Apache-2.0"
] | null | null | null | translate.py | ivan-mihailov/german_pdfs_ocr_project | 5a3e6122edf9786fefdf5b7458d7f8bb4dbc891f | [
"Apache-2.0"
] | null | null | null | translate.py | ivan-mihailov/german_pdfs_ocr_project | 5a3e6122edf9786fefdf5b7458d7f8bb4dbc891f | [
"Apache-2.0"
] | null | null | null | # Imports the Google Cloud Translation library
from google.cloud import translate
# Initialize Translation client
def translate_text(text="YOUR_TEXT_TO_TRANSLATE", project_id="YOUR_PROJECT_ID"):
"""Translating Text."""
client = translate.TranslationServiceClient()
location = "global"
parent = f"pro... | 32.5 | 80 | 0.682353 |
926b2fe44720345d5af340ea396c53fc3fc7dfc4 | 508 | py | Python | scripts/carracing/carracing_random.py | robertjankowski/ga-openai | f5d034459f783aa8f5103189030fca4153a124fd | [
"MIT"
] | 28 | 2019-11-02T13:16:03.000Z | 2022-03-22T12:08:12.000Z | scripts/carracing/carracing_random.py | robertjankowski/ga-openai | f5d034459f783aa8f5103189030fca4153a124fd | [
"MIT"
] | 1 | 2019-12-03T06:54:54.000Z | 2019-12-18T08:20:42.000Z | scripts/carracing/carracing_random.py | robertjankowski/ga-openai | f5d034459f783aa8f5103189030fca4153a124fd | [
"MIT"
] | 8 | 2020-04-30T22:12:27.000Z | 2021-07-07T20:09:53.000Z | import gym
import numpy as np
import torch
from nn.conv import ConvNet
if __name__ == '__main__':
env = gym.make('CarRacing-v0')
obs = env.reset()
nn = ConvNet()
for _ in range(100):
env.render()
obs = torch.from_numpy(np.flip(obs, axis=0).copy()).float()
obs = obs.reshape((-1... | 22.086957 | 67 | 0.564961 |
91621b0af2ca24a14310d420af3101c89da24eb5 | 1,449 | py | Python | Step_by_step/complex_lig_cof.py | lbfederico/gmx_scripts | c6c6faee2671c2612f69cc973e330836218692d5 | [
"MIT"
] | 2 | 2020-12-30T16:42:55.000Z | 2021-05-22T01:06:59.000Z | Step_by_step/complex_lig_cof.py | lbfederico/gmx_scripts | c6c6faee2671c2612f69cc973e330836218692d5 | [
"MIT"
] | null | null | null | Step_by_step/complex_lig_cof.py | lbfederico/gmx_scripts | c6c6faee2671c2612f69cc973e330836218692d5 | [
"MIT"
] | 1 | 2021-05-22T01:07:00.000Z | 2021-05-22T01:07:00.000Z | import sys
if len(sys.argv) < 4:
print('ERROR: Please put protein ligand and cofactor names. ')
else:
prot = sys.argv[1]
lig = sys.argv[2]
cof = sys.argv[3]
# Open and read protein file
file = open(str(prot), 'r')
prot = file.readlines()
#Build complex, Part1 -> prot ... | 27.339623 | 107 | 0.591442 |
8787363a08bd7aa02ce5c02fc8bc99ccae6630f1 | 30,223 | py | Python | tests/func/test_checkout.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | null | null | null | tests/func/test_checkout.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | 117 | 2021-04-05T10:04:24.000Z | 2022-03-31T20:21:23.000Z | tests/func/test_checkout.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | null | null | null | import collections
import filecmp
import logging
import os
import shutil
import stat
import textwrap
from unittest.mock import patch
import pytest
from dvc.dvcfile import DVC_FILE_SUFFIX, PIPELINE_FILE, Dvcfile
from dvc.exceptions import (
CheckoutError,
CheckoutErrorSuggestGit,
ConfirmRemoveError,
Dv... | 30.132602 | 79 | 0.616021 |
3062037ee633edfe608f19b212ba3c925be38888 | 4,829 | py | Python | yardstick/benchmark/scenarios/availability/monitor/basemonitor.py | rbbratta/yardstick | 7d1ffcd8eb41e9e4a09ed469b00ae4cbf2715529 | [
"Apache-2.0"
] | null | null | null | yardstick/benchmark/scenarios/availability/monitor/basemonitor.py | rbbratta/yardstick | 7d1ffcd8eb41e9e4a09ed469b00ae4cbf2715529 | [
"Apache-2.0"
] | null | null | null | yardstick/benchmark/scenarios/availability/monitor/basemonitor.py | rbbratta/yardstick | 7d1ffcd8eb41e9e4a09ed469b00ae4cbf2715529 | [
"Apache-2.0"
] | null | null | null | ##############################################################################
# Copyright (c) 2015 Huawei Technologies Co.,Ltd. and others
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, ... | 31.154839 | 78 | 0.605301 |
157b614e27a552f4b78c7e5d56f6723524fc3d0d | 12,441 | py | Python | Install/AppData/Roaming/Microsoft/AddIns/Perfect_Lecture/pdf2mp4_size_spec.py | kennywei815/Perfect_Lecture | 7f7cf6a06f4dcf86585010584cdf4c6825b94335 | [
"Apache-2.0"
] | 1 | 2021-08-16T02:51:26.000Z | 2021-08-16T02:51:26.000Z | Source/pdf2mp4_size_spec.py | kennywei815/Perfect_Lecture | 7f7cf6a06f4dcf86585010584cdf4c6825b94335 | [
"Apache-2.0"
] | null | null | null | Source/pdf2mp4_size_spec.py | kennywei815/Perfect_Lecture | 7f7cf6a06f4dcf86585010584cdf4c6825b94335 | [
"Apache-2.0"
] | 1 | 2021-08-16T02:51:27.000Z | 2021-08-16T02:51:27.000Z | import sys
import os
import shutil
import time
import xml.etree.ElementTree as et
import logging
# Logging
logging.basicConfig(stream=sys.stderr, level=logging.INFO) # RELEASE
# logging.basicConfig(stream=sys.stderr, level=logging.DEBUG) # DEBUG
def pause_exit():
## DEBUG
os.system('pause') #DEBUG
ex... | 44.274021 | 201 | 0.484045 |
1c50505ed45c8451c46826f283415e79c14171ae | 18,716 | py | Python | kombu/transport/SQS.py | alex/kombu | 3cb79f9c8c4db3c47c66b5419fd7a40d09758b87 | [
"BSD-3-Clause"
] | 1 | 2015-11-08T13:02:26.000Z | 2015-11-08T13:02:26.000Z | kombu/transport/SQS.py | alex/kombu | 3cb79f9c8c4db3c47c66b5419fd7a40d09758b87 | [
"BSD-3-Clause"
] | null | null | null | kombu/transport/SQS.py | alex/kombu | 3cb79f9c8c4db3c47c66b5419fd7a40d09758b87 | [
"BSD-3-Clause"
] | null | null | null | """
kombu.transport.SQS
===================
Amazon SQS transport module for Kombu. This package implements an AMQP-like
interface on top of Amazons SQS service, with the goal of being optimized for
high performance and reliability.
The default settings for this module are focused now on high performance in
task queue... | 34.467772 | 78 | 0.629141 |
2ac3bdc2ee0121c2c3ef4008fdfaed692571ac9c | 124,600 | py | Python | resources/usr/local/lib/python2.7/dist-packages/Cython/Compiler/ModuleNode.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | 1 | 2017-08-07T14:52:02.000Z | 2017-08-07T14:52:02.000Z | resources/usr/local/lib/python2.7/dist-packages/Cython/Compiler/ModuleNode.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | 3 | 2020-09-26T01:09:47.000Z | 2022-02-10T02:12:08.000Z | resources/usr/local/lib/python2.7/dist-packages/Cython/Compiler/ModuleNode.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | 1 | 2020-05-28T23:01:44.000Z | 2020-05-28T23:01:44.000Z | #
# Module parse tree node
#
from __future__ import absolute_import
import cython
cython.declare(Naming=object, Options=object, PyrexTypes=object, TypeSlots=object,
error=object, warning=object, py_object_type=object, UtilityCode=object,
EncodedString=object)
import json
import os
imp... | 43.551206 | 120 | 0.566172 |
73535c513e3205d95f1d2f9517520e396ac1b2bc | 452 | py | Python | example/demo_context.py | oggthemiffed/Flask-Spring | aad68df561fd6b759a03c8ab118d4b0619ce0cec | [
"MIT"
] | 1 | 2021-12-11T07:49:45.000Z | 2021-12-11T07:49:45.000Z | example/demo_context.py | oggthemiffed/Flask-Spring | aad68df561fd6b759a03c8ab118d4b0619ce0cec | [
"MIT"
] | null | null | null | example/demo_context.py | oggthemiffed/Flask-Spring | aad68df561fd6b759a03c8ab118d4b0619ce0cec | [
"MIT"
] | 1 | 2017-05-21T13:51:57.000Z | 2017-05-21T13:51:57.000Z | from springpython.config import PythonConfig, Object
from springpython.context import scope
from objects.test_obj import TestObject
__author__ = 'david'
class DemoApplicationContext(PythonConfig):
def __init__(self):
super (DemoApplicationContext, self).__init__()
@Object(scope.SINGLETON, lazy_init=T... | 28.25 | 56 | 0.730088 |
d0e7d8f3cfa3df2f8c0ef82de28d40205589d9cf | 26,781 | py | Python | lib/sqlalchemy/testing/fixtures.py | sqlalchemy-bot/sqlalchemy | c0736e0b2a3bf8c0952db84f5b9943df9ebf18f7 | [
"MIT"
] | null | null | null | lib/sqlalchemy/testing/fixtures.py | sqlalchemy-bot/sqlalchemy | c0736e0b2a3bf8c0952db84f5b9943df9ebf18f7 | [
"MIT"
] | null | null | null | lib/sqlalchemy/testing/fixtures.py | sqlalchemy-bot/sqlalchemy | c0736e0b2a3bf8c0952db84f5b9943df9ebf18f7 | [
"MIT"
] | null | null | null | # testing/fixtures.py
# Copyright (C) 2005-2022 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
# mypy: ignore-errors
from __future__ import annotations
import re
import sys... | 30.571918 | 79 | 0.540682 |
1338c4976b5d10cb9c4a852d735e6db48a00dac4 | 768 | py | Python | src/rics/translation/dio/exceptions.py | rsundqvist/rics | c67ff6703facb3170535dcf173d7e55734cedbc6 | [
"MIT"
] | 1 | 2022-02-24T22:12:13.000Z | 2022-02-24T22:12:13.000Z | src/rics/translation/dio/exceptions.py | rsundqvist/rics | c67ff6703facb3170535dcf173d7e55734cedbc6 | [
"MIT"
] | 26 | 2022-02-24T21:08:51.000Z | 2022-03-19T19:55:26.000Z | src/rics/translation/dio/exceptions.py | rsundqvist/rics | c67ff6703facb3170535dcf173d7e55734cedbc6 | [
"MIT"
] | null | null | null | """Data structure I exceptions."""
from typing import Any, Type
class DataStructureIOError(RuntimeError):
"""Base class for translator exceptions."""
class UntranslatableTypeError(DataStructureIOError):
"""Exception indicating that a type cannot be translated.
Args:
t: A type.
"""
de... | 25.6 | 98 | 0.686198 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.