hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c25caa5729ca807a4f8fc94fbdd63a52af090fc | 531 | py | Python | 4.hacker_rank/C.Algorithms/001_Warm_up/003_compare_the_triplets.py | jimmymalhan/Coding_Interview_Questions_Python_algoexpert | 94e8b4c63e8db92793b99741120a09f22806234f | [
"MIT"
] | 1 | 2020-10-05T04:55:26.000Z | 2020-10-05T04:55:26.000Z | 4.hacker_rank/C.Algorithms/001_Warm_up/003_compare_the_triplets.py | jimmymalhan/Coding_Interview_Questions_Python_algoexpert | 94e8b4c63e8db92793b99741120a09f22806234f | [
"MIT"
] | null | null | null | 4.hacker_rank/C.Algorithms/001_Warm_up/003_compare_the_triplets.py | jimmymalhan/Coding_Interview_Questions_Python_algoexpert | 94e8b4c63e8db92793b99741120a09f22806234f | [
"MIT"
] | null | null | null | # a = (a[0], a[1], a[2]) = (5,6,7) #alice
# b = (b[0], b[1], b[2]) = (3,6,10) # bob
# If a[i] > b[i], then Alice is awarded 1 point.
# If a[i] < b[i], then Bob is awarded 1 point.
# If a[i] = b[i], then neither person receives a point.
# a[0] > b[0], so Alice receives 1 point
# a[1] = b[1], so nobody receives a poin... | 31.235294 | 56 | 0.542373 | def compareTriplets(a, b):
a_score, b_score = 0, 0
for i in range(3):
a_score += a[i] > b[i]
b_score += a[i] < b[i]
return [a_score, b_score] | true | true |
1c25cbc48f507b14b051219856704bddac76cc43 | 14,868 | py | Python | lib/ansible/modules/cloud/alicloud/ali_instance_facts.py | Savasw/ansible-provider | 656c3acbec84eeaba9bf6958c88b397690f48723 | [
"Apache-2.0"
] | null | null | null | lib/ansible/modules/cloud/alicloud/ali_instance_facts.py | Savasw/ansible-provider | 656c3acbec84eeaba9bf6958c88b397690f48723 | [
"Apache-2.0"
] | null | null | null | lib/ansible/modules/cloud/alicloud/ali_instance_facts.py | Savasw/ansible-provider | 656c3acbec84eeaba9bf6958c88b397690f48723 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2017 Alibaba Group Holding Limited. He Guimin <heguimin36@163.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of ... | 35.4 | 125 | 0.576406 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: ali_instance_facts
version_added: "2.8"
sh... | true | true |
1c25cc42ae68a127fe51a6f301856fd02bbf9c25 | 3,019 | py | Python | lib/python2.7/site-packages/pelican/rstdirectives.py | craigriley39/pelican-site | 920d484feb67a2bd7bf9e3576edea7fa3325af2e | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/pelican/rstdirectives.py | craigriley39/pelican-site | 920d484feb67a2bd7bf9e3576edea7fa3325af2e | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/pelican/rstdirectives.py | craigriley39/pelican-site | 920d484feb67a2bd7bf9e3576edea7fa3325af2e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from docutils import nodes, utils
from docutils.parsers.rst import directives, roles, Directive
from pygments.formatters import HtmlFormatter
from pygments import highlight
from pygments.lexers import get_lexer_by_name, TextLexer
import re... | 33.544444 | 75 | 0.643922 |
from __future__ import unicode_literals, print_function
from docutils import nodes, utils
from docutils.parsers.rst import directives, roles, Directive
from pygments.formatters import HtmlFormatter
from pygments import highlight
from pygments.lexers import get_lexer_by_name, TextLexer
import re
import six
import peli... | true | true |
1c25ccf42baa882c77dd6f2a74e3eec7c9511214 | 1,034 | py | Python | kubernetes/test/test_apps_v1beta1_deployment_status.py | fooka03/python | 073cf4d89e532f92b57e8955b4efc3d5d5eb80cf | [
"Apache-2.0"
] | 2 | 2020-07-02T05:47:41.000Z | 2020-07-02T05:50:34.000Z | kubernetes/test/test_apps_v1beta1_deployment_status.py | fooka03/python | 073cf4d89e532f92b57e8955b4efc3d5d5eb80cf | [
"Apache-2.0"
] | 1 | 2021-03-25T23:44:49.000Z | 2021-03-25T23:44:49.000Z | k8sdeployment/k8sstat/python/kubernetes/test/test_apps_v1beta1_deployment_status.py | JeffYFHuang/gpuaccounting | afa934350ebbd0634beb60b9df4a147426ea0006 | [
"MIT"
] | 1 | 2021-10-13T17:45:37.000Z | 2021-10-13T17:45:37.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.6
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... | 25.85 | 124 | 0.743714 |
from __future__ import absolute_import
import unittest
import kubernetes.client
from kubernetes.client.models.apps_v1beta1_deployment_status import AppsV1beta1DeploymentStatus
from kubernetes.client.rest import ApiException
class TestAppsV1beta1DeploymentStatus(unittest.TestCase):
def setUp(self):
... | true | true |
1c25cde5217c538521a055ef68eae212c3f02327 | 465 | py | Python | src/hearth/_file_utils.py | leaprovenzano/hearth | 0f32f67a5d132e836a34fd7d7c982d7f35cf6c79 | [
"MIT"
] | null | null | null | src/hearth/_file_utils.py | leaprovenzano/hearth | 0f32f67a5d132e836a34fd7d7c982d7f35cf6c79 | [
"MIT"
] | 42 | 2020-12-14T18:04:41.000Z | 2022-02-06T12:30:14.000Z | src/hearth/_file_utils.py | leaprovenzano/hearth | 0f32f67a5d132e836a34fd7d7c982d7f35cf6c79 | [
"MIT"
] | 1 | 2021-08-03T06:59:46.000Z | 2021-08-03T06:59:46.000Z | import json
import pathlib
def save_json(obj, path: str):
with open(path, 'w') as f:
json.dump(obj, f)
def load_json(path: str):
with open(path, 'r') as f:
obj = json.load(f)
return obj
def mkdirs_if_not_exist(path, verbose: bool = False):
path = pathlib.Path(path)
if not path.... | 21.136364 | 66 | 0.612903 | import json
import pathlib
def save_json(obj, path: str):
with open(path, 'w') as f:
json.dump(obj, f)
def load_json(path: str):
with open(path, 'r') as f:
obj = json.load(f)
return obj
def mkdirs_if_not_exist(path, verbose: bool = False):
path = pathlib.Path(path)
if not path.... | true | true |
1c25cdfcb63071e77528cba1d4c8e6f2fb252f54 | 11,308 | py | Python | creat_data/CreatLableData.py | Dawn-K/Python_NLP | 269105f5aa04327587f02f0c48b1c8ae1573b569 | [
"MIT"
] | null | null | null | creat_data/CreatLableData.py | Dawn-K/Python_NLP | 269105f5aa04327587f02f0c48b1c8ae1573b569 | [
"MIT"
] | null | null | null | creat_data/CreatLableData.py | Dawn-K/Python_NLP | 269105f5aa04327587f02f0c48b1c8ae1573b569 | [
"MIT"
] | null | null | null | import random
import re
import copy
out_test_cn = None
out_test_en = None
out_generalization_cn = None
out_generalization_en = None
out_generalization3_cn = None
out_generalization3_en = None
c_tag_pattern = r'[\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b]'
c_tag_com = re.compile(c_tag_patt... | 36.477419 | 93 | 0.511319 | import random
import re
import copy
out_test_cn = None
out_test_en = None
out_generalization_cn = None
out_generalization_en = None
out_generalization3_cn = None
out_generalization3_en = None
c_tag_pattern = r'[\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b]'
c_tag_com = re.compile(c_tag_patt... | true | true |
1c25cec9baf8a08e1fbe8e12b94ab49344c070e2 | 2,363 | py | Python | Coursera Principles of Computing (Part 1, 2)/Week_8/Tic_Tac_Toe_Minimax.py | maistrovas/My-Courses-Solutions | 7a74add8e853f6c609d1f2656492e1c7c676a7e9 | [
"MIT"
] | null | null | null | Coursera Principles of Computing (Part 1, 2)/Week_8/Tic_Tac_Toe_Minimax.py | maistrovas/My-Courses-Solutions | 7a74add8e853f6c609d1f2656492e1c7c676a7e9 | [
"MIT"
] | null | null | null | Coursera Principles of Computing (Part 1, 2)/Week_8/Tic_Tac_Toe_Minimax.py | maistrovas/My-Courses-Solutions | 7a74add8e853f6c609d1f2656492e1c7c676a7e9 | [
"MIT"
] | null | null | null | """
Mini-max Tic-Tac-Toe Player
"""
import poc_ttt_gui
import poc_ttt_provided as provided
# Set timeout, as mini-max can take a long time
#import codeskulptor
#codeskulptor.set_timeout(60)
# SCORING VALUES - DO NOT MODIFY
SCORES = {provided.PLAYERX: 1,
provided.DRAW: 0,
provided.PL... | 31.092105 | 79 | 0.620821 |
import poc_ttt_gui
import poc_ttt_provided as provided
SCORES = {provided.PLAYERX: 1,
provided.DRAW: 0,
provided.PLAYERO: -1}
def make_full(board,player):
squares = board.get_empty_squares()
half_total = len(squares) / 3
counter = 0
for poss_move in board.get_emp... | true | true |
1c25cf170b72c6852eeaa64334cf5ded57f7f53a | 14,364 | py | Python | kubric/simulator/pybullet.py | ScottyLectronica/kubric | 31930b4a8517d1fc5987bb1502e47f130209505a | [
"Apache-2.0"
] | null | null | null | kubric/simulator/pybullet.py | ScottyLectronica/kubric | 31930b4a8517d1fc5987bb1502e47f130209505a | [
"Apache-2.0"
] | null | null | null | kubric/simulator/pybullet.py | ScottyLectronica/kubric | 31930b4a8517d1fc5987bb1502e47f130209505a | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 The Kubric Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 40.461972 | 101 | 0.689432 |
import logging
import pathlib
import sys
import tempfile
from typing import Dict, List, Optional, Tuple, Union
import tensorflow as tf
from singledispatchmethod import singledispatchmethod
from kubric import core
from kubric.redirect_io import RedirectStream
with RedirectStream(stream=... | true | true |
1c25cfe116ac2cb1f263e80c87dfd402e62fab01 | 7,137 | py | Python | sdk/core/azure-core/azure/core/pipeline/policies/retry_async.py | srinathnarayanan/azure-sdk-for-python | 2fc8a56afccfe9facd46e788b4b31b9ba6eb4b3d | [
"MIT"
] | null | null | null | sdk/core/azure-core/azure/core/pipeline/policies/retry_async.py | srinathnarayanan/azure-sdk-for-python | 2fc8a56afccfe9facd46e788b4b31b9ba6eb4b3d | [
"MIT"
] | null | null | null | sdk/core/azure-core/azure/core/pipeline/policies/retry_async.py | srinathnarayanan/azure-sdk-for-python | 2fc8a56afccfe9facd46e788b4b31b9ba6eb4b3d | [
"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""), ... | 44.886792 | 119 | 0.67059 |
from __future__ import absolute_import
import logging
from typing import TYPE_CHECKING, List, Callable, Iterator, Any, Union, Dict, Optional
from azure.core.exceptions import AzureError, ClientAuthenticationError
from .base import HTTPPolicy
from .base_async import AsyncHTTPPolicy
from .re... | true | true |
1c25d0323b8a29ee8e602141acdc5ee6bd9863e7 | 3,310 | py | Python | TimeWrapper_JE/venv/Lib/site-packages/requests_toolbelt/threaded/__init__.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | TimeWrapper_JE/venv/Lib/site-packages/requests_toolbelt/threaded/__init__.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | TimeWrapper_JE/venv/Lib/site-packages/requests_toolbelt/threaded/__init__.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | """
This module provides the API for ``requests_toolbelt.threaded``.
The module provides a clean and simple API for making requests via a thread
pool. The thread pool will use sessions for increased performance.
A simple use-case is:
.. code-block:: python
from requests_toolbelt import threaded
... | 33.77551 | 85 | 0.683988 | from . import pool
from .._compat import queue
def map(requests, **kwargs):
if not (requests and all(isinstance(r, dict) for r in requests)):
raise ValueError('map expects a list of dictionaries.')
job_queue = queue.Queue()
for request in requests:
job_queue.put(request)
... | true | true |
1c25d0b44f5ba84a6910fddc2bfe047beb7d20f2 | 1,247 | py | Python | model_change_example.py | Matcha-ice-cream/Seismic_Forward_Engine | c95b6bb4b9a5fa7a8ab45675dfa891ab8925c7ab | [
"MIT"
] | 3 | 2021-11-05T13:47:34.000Z | 2021-12-17T01:23:10.000Z | model_change_example.py | Matcha-ice-cream/Seismic_Forward_Engine | c95b6bb4b9a5fa7a8ab45675dfa891ab8925c7ab | [
"MIT"
] | null | null | null | model_change_example.py | Matcha-ice-cream/Seismic_Forward_Engine | c95b6bb4b9a5fa7a8ab45675dfa891ab8925c7ab | [
"MIT"
] | 4 | 2021-11-11T09:42:16.000Z | 2022-01-25T14:33:24.000Z | from re import S
import taichi as ti
from model.model_operation import getmodel
import Tools.SFE_tools as tools
import Visualization.SFE_visual as visual
import Tools.SFE_math as Smath
ti.init(arch=ti.gpu)
c_reverse = ti.field(ti.f32, shape = (500, 500))
pi = 3.1415926535
model_cs = getmodel(500, 500, 10, 10)
model_c... | 31.974359 | 67 | 0.746592 | from re import S
import taichi as ti
from model.model_operation import getmodel
import Tools.SFE_tools as tools
import Visualization.SFE_visual as visual
import Tools.SFE_math as Smath
ti.init(arch=ti.gpu)
c_reverse = ti.field(ti.f32, shape = (500, 500))
pi = 3.1415926535
model_cs = getmodel(500, 500, 10, 10)
model_c... | true | true |
1c25d0ff2cd2671ae2da590a87f79757d0eb74de | 497 | py | Python | app/main.py | BuildWeek-Post-Here-2/data-science | 584c08dec1ac0989d7f9e5027e8f21382124648c | [
"MIT"
] | 1 | 2020-07-31T16:14:13.000Z | 2020-07-31T16:14:13.000Z | app/main.py | BuildWeek-Post-Here-2/data-science | 584c08dec1ac0989d7f9e5027e8f21382124648c | [
"MIT"
] | null | null | null | app/main.py | BuildWeek-Post-Here-2/data-science | 584c08dec1ac0989d7f9e5027e8f21382124648c | [
"MIT"
] | null | null | null | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn
from app.api import predict, viz
app = FastAPI(
title='DS API',
description='Lorem ipsum',
version='0.1',
docs_url='/',
)
app.include_router(predict.router)
app.include_router(viz.router)
app.add_middlewar... | 17.75 | 50 | 0.692153 | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn
from app.api import predict, viz
app = FastAPI(
title='DS API',
description='Lorem ipsum',
version='0.1',
docs_url='/',
)
app.include_router(predict.router)
app.include_router(viz.router)
app.add_middlewar... | true | true |
1c25d117ff7193130e8790b1f41abe460cbd2370 | 461 | py | Python | mlapp.py | DhruvalDangar/Gender-Prediction | 032aada072426a9394588379be87736571842121 | [
"Apache-2.0"
] | null | null | null | mlapp.py | DhruvalDangar/Gender-Prediction | 032aada072426a9394588379be87736571842121 | [
"Apache-2.0"
] | null | null | null | mlapp.py | DhruvalDangar/Gender-Prediction | 032aada072426a9394588379be87736571842121 | [
"Apache-2.0"
] | null | null | null | import streamlit as st
import pickle
st.title ("Gender prediction using Decision tree classifier")
weight=st.number_input('Enter Weight (in kg)',0,150,10,10)
height=st.number_input('Enter Height (in cm)',0,250,10,10)
#weight=st.slider('Enter Weight',0,150)
#height=st.slider('Enter Height',0,250)
loadedmo... | 30.733333 | 62 | 0.722343 | import streamlit as st
import pickle
st.title ("Gender prediction using Decision tree classifier")
weight=st.number_input('Enter Weight (in kg)',0,150,10,10)
height=st.number_input('Enter Height (in cm)',0,250,10,10)
loadedmodel=pickle.load(open('finalmodel.pkl','rb'))
pred=loadedmodel.predict([[weight,... | true | true |
1c25d14605a86b5c88bbbc4dc7cdc7e4ecc3b9b3 | 216 | py | Python | semana2/mail_settings.py | ArseniumGX/bluemer-modulo2 | 24e5071b734de362dc47ef9d402c191699d15b43 | [
"MIT"
] | null | null | null | semana2/mail_settings.py | ArseniumGX/bluemer-modulo2 | 24e5071b734de362dc47ef9d402c191699d15b43 | [
"MIT"
] | null | null | null | semana2/mail_settings.py | ArseniumGX/bluemer-modulo2 | 24e5071b734de362dc47ef9d402c191699d15b43 | [
"MIT"
] | null | null | null | mail_settings = {
"MAIL_SERVER": 'smtp.gmail.com',
"MAIL_PORT": 465,
"MAIL_USE_TLS": False,
"MAIL_USE_SSL": True,
"MAIL_USERNAME": 'c003.teste.jp@gmail.com',
"MAIL_PASSWORD": 'C003.teste'
} | 27 | 47 | 0.625 | mail_settings = {
"MAIL_SERVER": 'smtp.gmail.com',
"MAIL_PORT": 465,
"MAIL_USE_TLS": False,
"MAIL_USE_SSL": True,
"MAIL_USERNAME": 'c003.teste.jp@gmail.com',
"MAIL_PASSWORD": 'C003.teste'
} | true | true |
1c25d1a6b4c2a68c3f2aeeab11499a1a4cb56628 | 6,027 | py | Python | contrib/tools/cython/Cython/Compiler/CythonScope.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | contrib/tools/cython/Cython/Compiler/CythonScope.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | contrib/tools/cython/Cython/Compiler/CythonScope.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | from __future__ import absolute_import
from .Symtab import ModuleScope
from .PyrexTypes import *
from .UtilityCode import CythonUtilityCode
from .Errors import error
from .Scanning import StringSourceDescriptor
from . import MemoryView
class CythonScope(ModuleScope):
is_cython_builtin = 1
_cythonscope_initia... | 36.527273 | 92 | 0.626348 | from __future__ import absolute_import
from .Symtab import ModuleScope
from .PyrexTypes import *
from .UtilityCode import CythonUtilityCode
from .Errors import error
from .Scanning import StringSourceDescriptor
from . import MemoryView
class CythonScope(ModuleScope):
is_cython_builtin = 1
_cythonscope_initia... | true | true |
1c25d1b70011b6cf38ef986d7faa02452bf4f103 | 28,718 | py | Python | biblecoin/abi.py | biblecoin/pybiblecoin | ac554b0dd4d695f7a1f85861c989e04196986f1d | [
"MIT"
] | null | null | null | biblecoin/abi.py | biblecoin/pybiblecoin | ac554b0dd4d695f7a1f85861c989e04196986f1d | [
"MIT"
] | null | null | null | biblecoin/abi.py | biblecoin/pybiblecoin | ac554b0dd4d695f7a1f85861c989e04196986f1d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
import ast
import re
import warnings
# use yaml instead of json to get non unicode (works with ascii only data)
import yaml
from rlp.utils import decode_hex
from biblecoin.utils import encode_hex
from biblecoin import utils
from biblecoin.utils import (
... | 33.315545 | 128 | 0.568041 |
from __future__ import print_function
import ast
import re
import warnings
import yaml
from rlp.utils import decode_hex
from biblecoin.utils import encode_hex
from biblecoin import utils
from biblecoin.utils import (
big_endian_to_int, ceil32, int_to_big_endian, encode_int, is_numeric, is_string,
rzpad, zp... | true | true |
1c25d21b1ea8e1666623555d1b20c3379c0f8672 | 1,699 | py | Python | models/text_generator.py | tuantran1810/advanced-nlp | 35b4f156f6e3c3efaaf0014b101aa33bdc519c6b | [
"MIT"
] | null | null | null | models/text_generator.py | tuantran1810/advanced-nlp | 35b4f156f6e3c3efaaf0014b101aa33bdc519c6b | [
"MIT"
] | null | null | null | models/text_generator.py | tuantran1810/advanced-nlp | 35b4f156f6e3c3efaaf0014b101aa33bdc519c6b | [
"MIT"
] | null | null | null | import torch
from torch import nn
import torch.nn.functional as F
from torch.autograd import Variable
class TextGeneratorModel(nn.Module):
def __init__(self, vocab_size, emb_size, hidden_lstm, string_length = 250, hidden_fc = 200, lstm_layers = 2, batch_size = 32):
super(TextGeneratorModel, self).__init__(... | 36.934783 | 130 | 0.629194 | import torch
from torch import nn
import torch.nn.functional as F
from torch.autograd import Variable
class TextGeneratorModel(nn.Module):
def __init__(self, vocab_size, emb_size, hidden_lstm, string_length = 250, hidden_fc = 200, lstm_layers = 2, batch_size = 32):
super(TextGeneratorModel, self).__init__(... | true | true |
1c25d2891058f437b2f47077dc4c6a6ab66b2874 | 1,082 | py | Python | yossarian/book_groups/migrations/0007_auto_20160116_1839.py | avinassh/yossarian | b485da0669d87ad29f57ba2a4a446131aaf820a6 | [
"MIT"
] | null | null | null | yossarian/book_groups/migrations/0007_auto_20160116_1839.py | avinassh/yossarian | b485da0669d87ad29f57ba2a4a446131aaf820a6 | [
"MIT"
] | null | null | null | yossarian/book_groups/migrations/0007_auto_20160116_1839.py | avinassh/yossarian | b485da0669d87ad29f57ba2a4a446131aaf820a6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-16 13:09
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('book_groups', '0006_auto_20160115_1843'),
]
operations = [
migrations.RemoveField(
... | 23.521739 | 51 | 0.527726 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('book_groups', '0006_auto_20160115_1843'),
]
operations = [
migrations.RemoveField(
model_name='comment',
name='author',
),... | true | true |
1c25d32048c5874e72dc1095d828add057bd5b47 | 23,277 | py | Python | slippy/contact/quasi_static_step.py | KDriesen/slippy | 816723fe6ab9f5ed26b14b4fe0f66423649b85e6 | [
"MIT"
] | 12 | 2020-12-06T15:30:06.000Z | 2021-12-14T06:37:15.000Z | slippy/contact/quasi_static_step.py | KDriesen/slippy | 816723fe6ab9f5ed26b14b4fe0f66423649b85e6 | [
"MIT"
] | null | null | null | slippy/contact/quasi_static_step.py | KDriesen/slippy | 816723fe6ab9f5ed26b14b4fe0f66423649b85e6 | [
"MIT"
] | 5 | 2021-03-18T05:53:11.000Z | 2022-02-16T15:18:43.000Z | import numpy as np
from numbers import Number
import typing
import warnings
from .steps import _ModelStep
from ._model_utils import get_gap_from_model
from ._step_utils import HeightOptimisationFunction, make_interpolation_func
__all__ = ['QuasiStaticStep']
class QuasiStaticStep(_ModelStep):
"""
A model ste... | 54.898585 | 120 | 0.633845 | import numpy as np
from numbers import Number
import typing
import warnings
from .steps import _ModelStep
from ._model_utils import get_gap_from_model
from ._step_utils import HeightOptimisationFunction, make_interpolation_func
__all__ = ['QuasiStaticStep']
class QuasiStaticStep(_ModelStep):
_just_touching_gap ... | true | true |
1c25d37a2f5de3fe4faa31318a66aeea899689cc | 9,818 | py | Python | src/consensus/multiprocess_validation.py | freddiecoleman/chia-blockchain | ef0971458b9293f65e393f5d283ab433e179b3bf | [
"Apache-2.0"
] | null | null | null | src/consensus/multiprocess_validation.py | freddiecoleman/chia-blockchain | ef0971458b9293f65e393f5d283ab433e179b3bf | [
"Apache-2.0"
] | 11 | 2021-09-28T15:10:47.000Z | 2022-03-22T15:14:16.000Z | src/consensus/multiprocess_validation.py | freddiecoleman/chia-blockchain | ef0971458b9293f65e393f5d283ab433e179b3bf | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import traceback
from concurrent.futures.process import ProcessPoolExecutor
from dataclasses import dataclass
from typing import List, Optional, Tuple, Dict, Union, Sequence
from src.consensus.block_header_validation import validate_finished_header_block
from src.consensus.blockchain_inte... | 43.061404 | 115 | 0.685985 | import asyncio
import logging
import traceback
from concurrent.futures.process import ProcessPoolExecutor
from dataclasses import dataclass
from typing import List, Optional, Tuple, Dict, Union, Sequence
from src.consensus.block_header_validation import validate_finished_header_block
from src.consensus.blockchain_inte... | true | true |
1c25d37f7018cf2f7df7dbefb51eb7064bbafad1 | 3,697 | py | Python | tests/records/test_systemfield_pid.py | inveniosoftware/invenio-resources | f1fb9a849d03af1d6ec4cddfc4e140a06788783b | [
"MIT"
] | null | null | null | tests/records/test_systemfield_pid.py | inveniosoftware/invenio-resources | f1fb9a849d03af1d6ec4cddfc4e140a06788783b | [
"MIT"
] | 19 | 2020-05-18T12:04:54.000Z | 2020-07-13T06:19:27.000Z | tests/records/test_systemfield_pid.py | inveniosoftware/invenio-resources | f1fb9a849d03af1d6ec4cddfc4e140a06788783b | [
"MIT"
] | 5 | 2020-04-28T09:07:43.000Z | 2020-07-01T14:43:01.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2020 Northwestern University.
#
# Invenio-Records-Resources is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""PIDField tests."""
from datetime import datetime
fr... | 33.008929 | 88 | 0.691371 |
from datetime import datetime
from invenio_pidstore.providers.recordid_v2 import RecordIdProviderV2
from mock_module.api import Record
from mock_module.models import RecordMetadata
from sqlalchemy import inspect
from invenio_records_resources.records.api import Record as RecordBase
from invenio_records_reso... | true | true |
1c25d50bfdfed8946956797742bcf088fba1cd87 | 7,207 | py | Python | studio/storage/storage_util.py | ilblackdragon/studio | ad8d8c7cff8b4ac6f791ceb881be24dafb2a8a55 | [
"Apache-2.0"
] | 397 | 2017-08-12T19:05:37.000Z | 2022-01-17T08:38:54.000Z | studio/storage/storage_util.py | ilblackdragon/studio | ad8d8c7cff8b4ac6f791ceb881be24dafb2a8a55 | [
"Apache-2.0"
] | 253 | 2017-08-14T16:06:20.000Z | 2021-08-16T20:14:54.000Z | studio/storage/storage_util.py | ilblackdragon/studio | ad8d8c7cff8b4ac6f791ceb881be24dafb2a8a55 | [
"Apache-2.0"
] | 59 | 2017-08-28T18:12:58.000Z | 2021-05-04T15:36:27.000Z | import os
import requests
import shutil
import time
import tarfile
import tempfile
from studio.artifacts import artifacts_tracker
from studio.util import util
def _find_ignore_list(local_path: str):
if os.path.isdir(local_path):
base_dir = local_path
else:
base_dir, last_name = os.path.split(l... | 35.678218 | 94 | 0.573748 | import os
import requests
import shutil
import time
import tarfile
import tempfile
from studio.artifacts import artifacts_tracker
from studio.util import util
def _find_ignore_list(local_path: str):
if os.path.isdir(local_path):
base_dir = local_path
else:
base_dir, last_name = os.path.split(l... | true | true |
1c25d5e2dec807f4f563b89c62462715338a5dec | 5,364 | py | Python | venv/Lib/site-packages/sklearn/datasets/_olivetti_faces.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sklearn/datasets/_olivetti_faces.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sklearn/datasets/_olivetti_faces.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | """Modified Olivetti faces dataset.
The original database was available from (now defunct)
https://www.cl.cam.ac.uk/research/dtg/attarchive/facedatabase.html
The version retrieved here comes in MATLAB format from the personal
web page of Sam Roweis:
https://cs.nyu.edu/~roweis/
"""
# Copyright (... | 36.243243 | 79 | 0.631618 |
from os.path import dirname, exists, join
from os import makedirs, remove
import numpy as np
from scipy.io.matlab import loadmat
import joblib
from . import get_data_home
from ._base import _fetch_remote
from ._base import RemoteFileMetadata
from ._base import _pkl_filepath
from ..utils import check_... | true | true |
1c25d6662ee77e8630cd053386c7ec4df84cd5ed | 18,296 | py | Python | commercialoperator/components/main/api.py | GraemeMuller/commercialoperator | 9218fb0a8844bc7f41cc371f4bd9488538df5fda | [
"Apache-2.0"
] | null | null | null | commercialoperator/components/main/api.py | GraemeMuller/commercialoperator | 9218fb0a8844bc7f41cc371f4bd9488538df5fda | [
"Apache-2.0"
] | 12 | 2020-02-12T06:26:55.000Z | 2022-02-13T05:52:54.000Z | commercialoperator/components/main/api.py | GraemeMuller/commercialoperator | 9218fb0a8844bc7f41cc371f4bd9488538df5fda | [
"Apache-2.0"
] | 8 | 2020-02-24T05:11:18.000Z | 2021-02-26T07:54:24.000Z | import traceback
from django.http import Http404, HttpResponse, HttpResponseRedirect, JsonResponse
from django.conf import settings
from django.db import transaction
from wsgiref.util import FileWrapper
from rest_framework import viewsets, serializers, status, generics, views
from rest_framework.decorators import detai... | 45.064039 | 561 | 0.704088 | import traceback
from django.http import Http404, HttpResponse, HttpResponseRedirect, JsonResponse
from django.conf import settings
from django.db import transaction
from wsgiref.util import FileWrapper
from rest_framework import viewsets, serializers, status, generics, views
from rest_framework.decorators import detai... | true | true |
1c25d6c646a1bc8df73d588f9b4c4fcd956558e3 | 5,978 | py | Python | NiaPy/tests/test_hde.py | lukapecnik/NiaPy | a40ac08a4c06a13019ec5e39cc137461884928b0 | [
"MIT"
] | 1 | 2020-03-16T11:15:43.000Z | 2020-03-16T11:15:43.000Z | NiaPy/tests/test_hde.py | lukapecnik/NiaPy | a40ac08a4c06a13019ec5e39cc137461884928b0 | [
"MIT"
] | null | null | null | NiaPy/tests/test_hde.py | lukapecnik/NiaPy | a40ac08a4c06a13019ec5e39cc137461884928b0 | [
"MIT"
] | 1 | 2020-03-25T16:20:36.000Z | 2020-03-25T16:20:36.000Z | # encoding=utf8
from numpy import random as rnd, array_equal
from NiaPy.algorithms.modified import DifferentialEvolutionMTS, DifferentialEvolutionMTSv1, MultiStrategyDifferentialEvolutionMTS, MultiStrategyDifferentialEvolutionMTSv1, DynNpMultiStrategyDifferentialEvolutionMTS, DynNpMultiStrategyDifferentialEvolutionMT... | 50.661017 | 324 | 0.828371 |
from numpy import random as rnd, array_equal
from NiaPy.algorithms.modified import DifferentialEvolutionMTS, DifferentialEvolutionMTSv1, MultiStrategyDifferentialEvolutionMTS, MultiStrategyDifferentialEvolutionMTSv1, DynNpMultiStrategyDifferentialEvolutionMTS, DynNpMultiStrategyDifferentialEvolutionMTSv1, DynNpDiffe... | true | true |
1c25d93540df112b6fc0843493f52ddb5f860f20 | 1,748 | py | Python | mlf_core/create/domains/mlf_core_template_struct.py | mlf-core/mlf-core | 016f6186b5b62622c3a2b3ca884331fe0165b97c | [
"Apache-2.0"
] | 31 | 2020-10-04T14:54:54.000Z | 2021-11-22T09:33:17.000Z | mlf_core/create/domains/mlf_core_template_struct.py | mlf-core/mlf_core | cea155595df95d1d22473605d29813f5d698d635 | [
"Apache-2.0"
] | 200 | 2020-08-05T13:51:14.000Z | 2022-03-28T00:25:54.000Z | mlf_core/create/domains/mlf_core_template_struct.py | mlf-core/mlf_core | cea155595df95d1d22473605d29813f5d698d635 | [
"Apache-2.0"
] | 3 | 2020-11-29T17:03:52.000Z | 2021-06-03T13:12:03.000Z | from dataclasses import dataclass
@dataclass
class MlfcoreTemplateStruct:
"""
First section declares the variables that all template have in common
"""
mlf_core_version: str = "" # Version of mlf-core, which was used for creating the project
domain: str = "" # Domain of the template
languag... | 52.969697 | 116 | 0.704805 | from dataclasses import dataclass
@dataclass
class MlfcoreTemplateStruct:
mlf_core_version: str = ""
domain: str = ""
language: str = ""
project_slug: str = ""
project_slug_no_hyphen: str = ""
template_version: str = ""
template_handle: str = ""
github_username: str = ""... | true | true |
1c25d9851c01a24dfea3a2d77566b7c0b911e2d8 | 797 | py | Python | minesweeper/test/uncategorized_test.py | newnone/Multiplayer-Minesweeper | 054adc4a14a710dfdd479791b9d1d40df061211c | [
"MIT"
] | null | null | null | minesweeper/test/uncategorized_test.py | newnone/Multiplayer-Minesweeper | 054adc4a14a710dfdd479791b9d1d40df061211c | [
"MIT"
] | null | null | null | minesweeper/test/uncategorized_test.py | newnone/Multiplayer-Minesweeper | 054adc4a14a710dfdd479791b9d1d40df061211c | [
"MIT"
] | null | null | null | import unittest
import math
from minesweeper.utils import digits
class UncategorizedTest(unittest.TestCase):
def test_digits(self):
"""
Tests digits functions from minesweeper.utils
"""
expected_output = {
-(10 ** 5): 6, -1000: 4, -100: 3, -10: 2, -9: 1, -math.pi: 1... | 29.518519 | 117 | 0.504391 | import unittest
import math
from minesweeper.utils import digits
class UncategorizedTest(unittest.TestCase):
def test_digits(self):
expected_output = {
-(10 ** 5): 6, -1000: 4, -100: 3, -10: 2, -9: 1, -math.pi: 1, -1: 1, -0.5555: 1,
0: 1, 0.5555: 1, 0.999999: 1, 10: 2, math.pi: 1, ... | true | true |
1c25d9968a905e73ad7f55bd37612733304dc810 | 10,054 | py | Python | webapp/main.py | Woods26/mvMapper | 8caf9f82d742fb8066b94a4d9b5d678ff393b3c0 | [
"BSD-2-Clause"
] | null | null | null | webapp/main.py | Woods26/mvMapper | 8caf9f82d742fb8066b94a4d9b5d678ff393b3c0 | [
"BSD-2-Clause"
] | null | null | null | webapp/main.py | Woods26/mvMapper | 8caf9f82d742fb8066b94a4d9b5d678ff393b3c0 | [
"BSD-2-Clause"
] | null | null | null | import argparse
import io
import json
import logging
import os
import uuid
import markdown2
import pandas
import pytoml
import tornado
# noinspection PyUnresolvedReferences
from app import modify_doc
from bokeh.application import Application as bkApplication
from bokeh.application.handlers import FunctionHandler as bk... | 43.150215 | 131 | 0.524667 | import argparse
import io
import json
import logging
import os
import uuid
import markdown2
import pandas
import pytoml
import tornado
from app import modify_doc
from bokeh.application import Application as bkApplication
from bokeh.application.handlers import FunctionHandler as bkFunctionHandler
from bokeh.embed impo... | true | true |
1c25d9ac4abc46d648f2cbee5a4c17fc19c74625 | 4,255 | py | Python | trans_d.py | WeidongLi-KG/KBGAN_Pytorch-v0.4.1 | 26f545ecf305ee1fc428901313a45b9766280433 | [
"MIT"
] | 202 | 2018-02-28T03:09:08.000Z | 2022-03-25T15:45:21.000Z | trans_d.py | WeidongLi-KG/KBGAN_Pytorch-v0.4.1 | 26f545ecf305ee1fc428901313a45b9766280433 | [
"MIT"
] | 10 | 2018-03-10T08:03:33.000Z | 2021-05-01T14:30:36.000Z | trans_d.py | WeidongLi-KG/KBGAN_Pytorch-v0.4.1 | 26f545ecf305ee1fc428901313a45b9766280433 | [
"MIT"
] | 54 | 2018-03-01T12:26:00.000Z | 2021-12-10T08:14:59.000Z | import os
import logging
import numpy as np
import torch as t
import torch.nn as nn
import torch.nn.functional as f
from config import config
from torch.optim import Adam, SGD, Adagrad
from torch.autograd import Variable
from data_utils import batch_by_num
from base_model import BaseModel, BaseModule
class TransDModul... | 41.31068 | 121 | 0.604935 | import os
import logging
import numpy as np
import torch as t
import torch.nn as nn
import torch.nn.functional as f
from config import config
from torch.optim import Adam, SGD, Adagrad
from torch.autograd import Variable
from data_utils import batch_by_num
from base_model import BaseModel, BaseModule
class TransDModul... | true | true |
1c25d9c2440e65ab689b56788f18539307472528 | 9,635 | py | Python | sc2/sc2process.py | Sc2-AI-Cup/example-bot-marinerush | 2f8a7b1026dbe947fe1177b18181d91afc4a12f5 | [
"MIT"
] | null | null | null | sc2/sc2process.py | Sc2-AI-Cup/example-bot-marinerush | 2f8a7b1026dbe947fe1177b18181d91afc4a12f5 | [
"MIT"
] | null | null | null | sc2/sc2process.py | Sc2-AI-Cup/example-bot-marinerush | 2f8a7b1026dbe947fe1177b18181d91afc4a12f5 | [
"MIT"
] | null | null | null | import asyncio
import os
import os.path
import shutil
import signal
import subprocess
import sys
import tempfile
import time
from contextlib import suppress
from typing import Any, Dict, List, Optional, Tuple, Union
import aiohttp
import portpicker
from loguru import logger
from sc2 import paths, wsl
from sc2.control... | 35.036364 | 180 | 0.584017 | import asyncio
import os
import os.path
import shutil
import signal
import subprocess
import sys
import tempfile
import time
from contextlib import suppress
from typing import Any, Dict, List, Optional, Tuple, Union
import aiohttp
import portpicker
from loguru import logger
from sc2 import paths, wsl
from sc2.control... | true | true |
1c25da51d8bba429c10876efee27816a68d26f3f | 1,555 | py | Python | pipeline/__init__.py | juridics/brazilian-legal-text-dataset | 298e031972331725a052fb40931d7feb3e49c429 | [
"Unlicense"
] | 1 | 2022-02-24T12:35:47.000Z | 2022-02-24T12:35:47.000Z | pipeline/__init__.py | juridics/brazilian-legal-text-dataset | 298e031972331725a052fb40931d7feb3e49c429 | [
"Unlicense"
] | null | null | null | pipeline/__init__.py | juridics/brazilian-legal-text-dataset | 298e031972331725a052fb40931d7feb3e49c429 | [
"Unlicense"
] | null | null | null | from .exporters import mlm_exporter, sts_exporter, query_exporter
from .parsers import mlm_parsers, sts_parsers
from .scrapers import mlm_scrapers, sts_scrapers
from .utils import WorkProgress
class MlmPipelineManager:
def __init__(self):
self.work_progress = WorkProgress()
def execute(self, task):
... | 31.734694 | 65 | 0.628296 | from .exporters import mlm_exporter, sts_exporter, query_exporter
from .parsers import mlm_parsers, sts_parsers
from .scrapers import mlm_scrapers, sts_scrapers
from .utils import WorkProgress
class MlmPipelineManager:
def __init__(self):
self.work_progress = WorkProgress()
def execute(self, task):
... | true | true |
1c25da7c2b3df3d5891de4da24d57cf17fb54c44 | 4,876 | py | Python | rgf_grape/optimization/wireOptimizer.py | SamBoutin/majorana-rgf-grape | 3233627125519a3cc36b1d167c00d39b54abc48d | [
"BSD-2-Clause"
] | null | null | null | rgf_grape/optimization/wireOptimizer.py | SamBoutin/majorana-rgf-grape | 3233627125519a3cc36b1d167c00d39b54abc48d | [
"BSD-2-Clause"
] | null | null | null | rgf_grape/optimization/wireOptimizer.py | SamBoutin/majorana-rgf-grape | 3233627125519a3cc36b1d167c00d39b54abc48d | [
"BSD-2-Clause"
] | null | null | null | """
This file is part of the rgf_grape python package.
Copyright (C) 2017-2018 S. Boutin
For details of the rgf_grape algorithm and applications see:
S. Boutin, J. Camirand Lemyre, and I. Garate, Majorana bound state engineering
via efficient real-space parameter optimization, ArXiv 1804.03170 (2018).
"""
import nump... | 33.170068 | 89 | 0.546965 |
import numpy as np
import scipy.optimize
class StopOptimizingException(Exception):
pass
class TakeStepBH(object):
def __init__(self, stepsize=1, scaling=None, bounds=None, dim=1):
self.stepsize = stepsize
self.dim =dim
if scaling is None:
self.scaling = np.ones(dim)
... | true | true |
1c25db04f7603f7d2125384ae17ac474cb7fd4ef | 1,516 | py | Python | tests/tests/artifact.py | andhe/mender-cli | 2ca90a8c127ab43030208c71ce0c352e97ef6396 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/tests/artifact.py | andhe/mender-cli | 2ca90a8c127ab43030208c71ce0c352e97ef6396 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/tests/artifact.py | andhe/mender-cli | 2ca90a8c127ab43030208c71ce0c352e97ef6396 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2018 Mender Software AS
#
# 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... | 36.095238 | 124 | 0.649077 |
import tempfile
import logging
import cli
MENDER_ARTIFACT_TOOL = 'tests/mender-artifact'
def create_artifact_file(outpath):
with tempfile.NamedTemporaryFile(prefix='menderin') as infile:
logging.info('writing mender artifact to %s', outpath)
infile.write(b'bogus test data')
... | true | true |
1c25dbe0ddb1154550507577807e932ac91b810f | 1,398 | py | Python | lewdd/gelbooru.py | StellaSmith/lewd_downloader | 99c8f44f3196219f4b81d38e5abcdc8879b86a05 | [
"Unlicense"
] | 2 | 2019-02-20T14:38:42.000Z | 2021-11-08T20:36:37.000Z | lewdd/gelbooru.py | StellaSmith/lewd_downloader | 99c8f44f3196219f4b81d38e5abcdc8879b86a05 | [
"Unlicense"
] | 1 | 2021-08-22T04:17:37.000Z | 2021-08-22T04:17:37.000Z | lewdd/gelbooru.py | StellaSmith/lewd_downloader | 99c8f44f3196219f4b81d38e5abcdc8879b86a05 | [
"Unlicense"
] | 3 | 2019-09-10T18:33:04.000Z | 2020-09-27T21:35:46.000Z | import os
import xml.etree.ElementTree
import math
from ._utils import *
from .danbooru import format_tags
from .rule34_xxx import images_per_page
domain = "gelbooru.com"
images_per_page = 20
_api_url = "https://" + domain + "/index.php?page=dapi&s=post&q=index"
def get_max_page(tags):
url = _api_url + "&tags=... | 26.377358 | 74 | 0.642346 | import os
import xml.etree.ElementTree
import math
from ._utils import *
from .danbooru import format_tags
from .rule34_xxx import images_per_page
domain = "gelbooru.com"
images_per_page = 20
_api_url = "https://" + domain + "/index.php?page=dapi&s=post&q=index"
def get_max_page(tags):
url = _api_url + "&tags=... | true | true |
1c25dbedcdeee1d703897d7ba2cef786426ef7ff | 5,226 | py | Python | tests/helpers/test_check_config.py | CtrlZvi/core | ed16c5078ff4b2351f0d55237d962e4fb17d39f0 | [
"Apache-2.0"
] | null | null | null | tests/helpers/test_check_config.py | CtrlZvi/core | ed16c5078ff4b2351f0d55237d962e4fb17d39f0 | [
"Apache-2.0"
] | 44 | 2020-12-21T08:17:34.000Z | 2022-03-31T06:04:31.000Z | tests/helpers/test_check_config.py | breiti/homeassistant-core | dc8364fd3a33f302356c3a0f7248b0ab9160088d | [
"Apache-2.0"
] | null | null | null | """Test check_config helper."""
import logging
from homeassistant.config import YAML_CONFIG_FILE
from homeassistant.helpers.check_config import (
CheckConfigError,
async_check_ha_config_file,
)
from tests.async_mock import patch
from tests.common import patch_yaml_files
_LOGGER = logging.getLogger(__name__)
... | 30.923077 | 87 | 0.649828 | import logging
from homeassistant.config import YAML_CONFIG_FILE
from homeassistant.helpers.check_config import (
CheckConfigError,
async_check_ha_config_file,
)
from tests.async_mock import patch
from tests.common import patch_yaml_files
_LOGGER = logging.getLogger(__name__)
BASE_CONFIG = (
"homeassist... | true | true |
1c25dc188962040867981666237cff584ce9de59 | 557 | py | Python | py_rfq_helper/plotbunchdata.py | DanielWinklehner/py_rfq_helper | 98a471f529c9418f822c7c711bcbd8dd50bbb0ff | [
"MIT"
] | 1 | 2021-03-11T05:55:02.000Z | 2021-03-11T05:55:02.000Z | py_rfq_helper/plotbunchdata.py | DanielWinklehner/py_rfq_helper | 98a471f529c9418f822c7c711bcbd8dd50bbb0ff | [
"MIT"
] | null | null | null | py_rfq_helper/plotbunchdata.py | DanielWinklehner/py_rfq_helper | 98a471f529c9418f822c7c711bcbd8dd50bbb0ff | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import pickle
import numpy as np
bunch = pickle.load(open("bunch_particles.2.dump", "rb"))
z = bunch["z"]
vz = bunch["vz"]
y = bunch["y"]
x = bunch["x"]
xp = bunch["xp"]
yp = bunch["yp"]
idx = np.where(vz > 2.5e6)
#idx = np.where(vz > 0)
plt.scatter(z[idx] - np.mean(z[idx]), vz[idx], ... | 20.62963 | 62 | 0.608618 | import matplotlib.pyplot as plt
import pickle
import numpy as np
bunch = pickle.load(open("bunch_particles.2.dump", "rb"))
z = bunch["z"]
vz = bunch["vz"]
y = bunch["y"]
x = bunch["x"]
xp = bunch["xp"]
yp = bunch["yp"]
idx = np.where(vz > 2.5e6)
plt.scatter(z[idx] - np.mean(z[idx]), vz[idx], 15, marker='.')
plt.xla... | true | true |
1c25dc26e0ad9de3d96c2d5fe36394017637be04 | 2,508 | py | Python | src/tpsd.py | andreamust/TPSD | aa2bd70fb0439c9bea6cac949bb2fc555b187245 | [
"MIT"
] | 1 | 2022-03-24T16:05:59.000Z | 2022-03-24T16:05:59.000Z | src/tpsd.py | andreamust/TPSD | aa2bd70fb0439c9bea6cac949bb2fc555b187245 | [
"MIT"
] | null | null | null | src/tpsd.py | andreamust/TPSD | aa2bd70fb0439c9bea6cac949bb2fc555b187245 | [
"MIT"
] | null | null | null | # pylint: disable=line-too-long
"""
This script contains a Python 3 re-implementation of the Tonal Pith Space Distance (TPSD) algorithm as presented in:
De Haas, W.B., Veltkamp, R.C., Wiering, F.: Tonal pitch step distance: a similarity measure for chord progressions.
In: ISMIR. pp. 51–56 (2008)
Author: Andrea Poltro... | 38 | 117 | 0.669856 |
import matplotlib.pyplot as plt
import numpy as np
from src.tps_comparison import TpsComparison
class Tpsd:
def __init__(self, chord_sequence: list[str], key: str, timing_information: list[int]) -> None:
self.key = key
self.chord_sequence = chord_sequence
self.timing_informati... | true | true |
1c25dc58c1e714fce6c8ea025f4d92ef7b1c5cc5 | 2,061 | py | Python | database_setup.py | AlikZi/udacity-fullstack-catalog-project4 | 8b7f22ee6a33b1bd683c185cc881e484bbc52876 | [
"MIT"
] | null | null | null | database_setup.py | AlikZi/udacity-fullstack-catalog-project4 | 8b7f22ee6a33b1bd683c185cc881e484bbc52876 | [
"MIT"
] | 4 | 2020-03-24T16:47:29.000Z | 2021-02-08T20:28:09.000Z | database_setup.py | AlikZi/udacity-fullstack-catalog-project4 | 8b7f22ee6a33b1bd683c185cc881e484bbc52876 | [
"MIT"
] | null | null | null | '''
Setup database for the Furniture Catalog Application
'''
import datetime
from sqlalchemy import Column, ForeignKey, Integer, String, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref
from sqlalchemy import create_engine
Base = declarative_base()
cla... | 29.028169 | 78 | 0.664726 | import datetime
from sqlalchemy import Column, ForeignKey, Integer, String, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref
from sqlalchemy import create_engine
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(In... | true | true |
1c25dd1fcc5c62a42be0bcf4aa705f540ad01d48 | 2,293 | py | Python | vggish/vggish_params.py | cxqj/33-tensorflow-audio-classification | 934162d497a66bc59c87f527448464e121a3a306 | [
"Apache-2.0"
] | 85 | 2018-11-22T18:16:57.000Z | 2022-03-15T03:40:16.000Z | vggish/vggish_params.py | cxqj/33-tensorflow-audio-classification | 934162d497a66bc59c87f527448464e121a3a306 | [
"Apache-2.0"
] | 3 | 2019-04-27T02:43:46.000Z | 2020-09-09T07:28:06.000Z | vggish/vggish_params.py | cxqj/33-tensorflow-audio-classification | 934162d497a66bc59c87f527448464e121a3a306 | [
"Apache-2.0"
] | 25 | 2019-01-31T10:06:20.000Z | 2022-02-27T13:53:59.000Z | # Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 36.983871 | 80 | 0.75447 |
from os.path import join as pjoin
NUM_FRAMES = 96
NUM_BANDS = 64
EMBEDDING_SIZE = 128
SAMPLE_RATE = 16000
STFT_WINDOW_LENGTH_SECONDS = 0.025
STFT_HOP_LENGTH_SECONDS = 0.010
NUM_MEL_BINS = NUM_BANDS
MEL_MIN_HZ = 125
MEL_MAX_HZ = 7500
LOG_OFFSET = 0.01
EXAMPLE_WINDOW_SECONDS = 0.96
EXAMPLE_H... | true | true |
1c25dd96a07fae2e72f5e22e1fbca15bd33c1a48 | 15,286 | py | Python | apps/rss_feeds/icon_importer.py | louis-pre/NewsBlur | b4e9a56041ff187ef77b38dfd0778daf41b53f4f | [
"MIT"
] | 3,073 | 2015-01-01T07:20:18.000Z | 2022-03-31T20:33:41.000Z | apps/rss_feeds/icon_importer.py | louis-pre/NewsBlur | b4e9a56041ff187ef77b38dfd0778daf41b53f4f | [
"MIT"
] | 1,054 | 2015-01-02T13:32:35.000Z | 2022-03-30T04:21:21.000Z | apps/rss_feeds/icon_importer.py | louis-pre/NewsBlur | b4e9a56041ff187ef77b38dfd0778daf41b53f4f | [
"MIT"
] | 676 | 2015-01-03T16:40:29.000Z | 2022-03-30T14:00:40.000Z | import urllib.request
import urllib.error
import urllib.parse
import lxml.html
import numpy
import scipy
import scipy.misc
import scipy.cluster
import struct
import operator
import gzip
import datetime
import requests
import base64
import http.client
from PIL import BmpImagePlugin, PngImagePlugin, Image
from socket imp... | 37.192214 | 126 | 0.550242 | import urllib.request
import urllib.error
import urllib.parse
import lxml.html
import numpy
import scipy
import scipy.misc
import scipy.cluster
import struct
import operator
import gzip
import datetime
import requests
import base64
import http.client
from PIL import BmpImagePlugin, PngImagePlugin, Image
from socket imp... | true | true |
1c25de30b1450718404fd21820939215530d7336 | 2,827 | py | Python | src/clients/ctm_api_client/models/key_value_type_list_result.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 5 | 2021-12-01T18:40:00.000Z | 2022-03-04T10:51:44.000Z | src/clients/ctm_api_client/models/key_value_type_list_result.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 3 | 2022-02-21T20:08:32.000Z | 2022-03-16T17:41:03.000Z | src/clients/ctm_api_client/models/key_value_type_list_result.py | IceT-M/ctm-python-client | 0ef1d8a3c9a27a01c088be1cdf5d177d25912bac | [
"BSD-3-Clause"
] | 7 | 2021-12-01T11:59:16.000Z | 2022-03-01T18:16:40.000Z | # coding: utf-8
"""
Control-M Services
Provides access to BMC Control-M Services # noqa: E501
OpenAPI spec version: 9.20.215
Contact: customer_support@bmc.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from clients.ct... | 29.447917 | 85 | 0.564202 |
import pprint
import re
import six
from clients.ctm_api_client.configuration import Configuration
class KeyValueTypeListResult(object):
swagger_types = {}
attribute_map = {}
def __init__(self, _configuration=None):
if _configuration is None:
_configuration = Configuration(... | true | true |
1c25dff5eff5c8fc3ad910e161ed81fc344a3559 | 11,200 | py | Python | src/experiment.py | prog-autom/hidden-demo | 26912cc2abe9984f204b9d5e0b1defb49a59d326 | [
"MIT"
] | 1 | 2021-07-20T13:58:43.000Z | 2021-07-20T13:58:43.000Z | src/experiment.py | prog-autom/hidden-demo | 26912cc2abe9984f204b9d5e0b1defb49a59d326 | [
"MIT"
] | null | null | null | src/experiment.py | prog-autom/hidden-demo | 26912cc2abe9984f204b9d5e0b1defb49a59d326 | [
"MIT"
] | 1 | 2021-06-14T20:00:02.000Z | 2021-06-14T20:00:02.000Z | from sklearn import datasets
import numpy as np
from matplotlib import pyplot as plt
import seaborn as sb
from sklearn.linear_model import RidgeCV
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error
from sklearn import model_selection
fro... | 35.782748 | 136 | 0.625089 | from sklearn import datasets
import numpy as np
from matplotlib import pyplot as plt
import seaborn as sb
from sklearn.linear_model import RidgeCV
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error
from sklearn import model_selection
fro... | true | true |
1c25e00709c1ee7777a74eaea4c1b9eb951d710f | 264 | py | Python | python_3/aula14c.py | felipesch92/CursoEmVideo | df443e4771adc4506c96d8f419aa7acb97b28366 | [
"MIT"
] | null | null | null | python_3/aula14c.py | felipesch92/CursoEmVideo | df443e4771adc4506c96d8f419aa7acb97b28366 | [
"MIT"
] | null | null | null | python_3/aula14c.py | felipesch92/CursoEmVideo | df443e4771adc4506c96d8f419aa7acb97b28366 | [
"MIT"
] | null | null | null | n = 1
c = 0
p = 0
i = 0
while n != 0:
n = int(input('Digite um valor: '))
if n != 0:
c += 1
if n % 2 == 0:
p += 1
else:
i += 1
print('Dos {} números digitados {} são pares e {} são ímpares.'.format(c, p, i))
| 18.857143 | 80 | 0.409091 | n = 1
c = 0
p = 0
i = 0
while n != 0:
n = int(input('Digite um valor: '))
if n != 0:
c += 1
if n % 2 == 0:
p += 1
else:
i += 1
print('Dos {} números digitados {} são pares e {} são ímpares.'.format(c, p, i))
| true | true |
1c25e0a60b8d2be6774b3c148fed6f8d895be99d | 7,169 | py | Python | app.py | ashrefm/dt-grade-prediction | 6600f5fed8ccb44ba5493694ba57185742e6c898 | [
"MIT"
] | 1 | 2021-03-22T14:41:27.000Z | 2021-03-22T14:41:27.000Z | app.py | ashrefm/dt-grade-prediction | 6600f5fed8ccb44ba5493694ba57185742e6c898 | [
"MIT"
] | null | null | null | app.py | ashrefm/dt-grade-prediction | 6600f5fed8ccb44ba5493694ba57185742e6c898 | [
"MIT"
] | 2 | 2021-11-20T06:10:42.000Z | 2021-12-08T18:06:20.000Z | # MIT License
#
# Copyright (c) 2019 Mohamed-Achref MAIZA
#
# 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 without restriction, including without limitation the
# rights to use, copy, modify, ... | 38.132979 | 120 | 0.68029 |
import json
import os
import numpy as np
from numpy.linalg import norm
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix, classification_report
from sklearn.externals import joblib
from pyemd import emd... | true | true |
1c25e14a6f4b58ac84dc907434e2c00bc15c6987 | 155 | py | Python | lang/py/cookbook/v2/source/cb2_4_21_exm_1.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | lang/py/cookbook/v2/source/cb2_4_21_exm_1.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | lang/py/cookbook/v2/source/cb2_4_21_exm_1.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | null | null | null | assert len(some_list) == len(probabilities)
assert 0 <= min(probabilities) and max(probabilities) <= 1
assert abs(sum(probabilities)-1.0) < 1.0e-5
| 38.75 | 62 | 0.696774 | assert len(some_list) == len(probabilities)
assert 0 <= min(probabilities) and max(probabilities) <= 1
assert abs(sum(probabilities)-1.0) < 1.0e-5
| false | true |
1c25e1e998bb1fb59cb299ce08a7a4b5a01362f6 | 19,951 | py | Python | ball_catching/dynamics/world.py | shoefer/ball_catching | 46b2e95894659347b563123c1c23742437755993 | [
"MIT"
] | 1 | 2017-07-22T11:36:02.000Z | 2017-07-22T11:36:02.000Z | ball_catching/dynamics/world.py | shoefer/ball_catching | 46b2e95894659347b563123c1c23742437755993 | [
"MIT"
] | null | null | null | ball_catching/dynamics/world.py | shoefer/ball_catching | 46b2e95894659347b563123c1c23742437755993 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 16 11:24:25 2016
@author: shoefer
"""
import numpy as np
import os
import pandas as pd
from ball_catching.utils.cont2discrete import cont2discrete
# -----
# state dim
# 0 -> xb
# 1 -> xb'
# 2 -> xb''
# 3 -> yb
# 4 -> yb'
# 5 -> yb''
# 6 -> zb
# 7 -> zb'... | 28.872648 | 106 | 0.520475 |
import numpy as np
import os
import pandas as pd
from ball_catching.utils.cont2discrete import cont2discrete
# 2 -> xb''
# 3 -> yb
# 4 -> yb'
# 8 -> zb''
#
# 9 -> xa
# 10 -> xa'
# 14 -> za''
STATE_DIM = 15
# -----
# action dim
ACTION_DIM = 2
# -----
# system
A = np.array([[0, 1, 0, 0, 0, ... | true | true |
1c25e2c8f846cee624f5f82c825882cb8e426a76 | 2,478 | py | Python | vision/vision_app/vision_app/utils.py | gubtos/forecast-webservice | 27927804d2296f11c871b1b7638a9aa67b866e07 | [
"MIT"
] | null | null | null | vision/vision_app/vision_app/utils.py | gubtos/forecast-webservice | 27927804d2296f11c871b1b7638a9aa67b866e07 | [
"MIT"
] | null | null | null | vision/vision_app/vision_app/utils.py | gubtos/forecast-webservice | 27927804d2296f11c871b1b7638a9aa67b866e07 | [
"MIT"
] | 1 | 2019-11-09T21:35:07.000Z | 2019-11-09T21:35:07.000Z | import requests
import json
from datetime import date, datetime
from traceback import print_exc
from vision_app import db
from vision_app.config import CLIMATEMPO_API_KEY
from .models import City, ForecastWeather
def update():
'''Update forecasts weather from all cities'''
cities = City.query.all()
for c... | 30.219512 | 129 | 0.58636 | import requests
import json
from datetime import date, datetime
from traceback import print_exc
from vision_app import db
from vision_app.config import CLIMATEMPO_API_KEY
from .models import City, ForecastWeather
def update():
cities = City.query.all()
for city in cities:
save_city_data(city.id)
... | true | true |
1c25e34db0d14cb297dd2802bdd8f9b276788975 | 1,055 | py | Python | rrtcmp/misc.py | Tastalian/avp-rrt-rss-2013 | d3d9b50bb582c23a4ee83408b26bcede4d84469e | [
"Apache-2.0"
] | 2 | 2018-08-21T15:25:58.000Z | 2019-03-24T02:52:47.000Z | rrtcmp/misc.py | Tastalian/avp-rrt-rss-2013 | d3d9b50bb582c23a4ee83408b26bcede4d84469e | [
"Apache-2.0"
] | null | null | null | rrtcmp/misc.py | Tastalian/avp-rrt-rss-2013 | d3d9b50bb582c23a4ee83408b26bcede4d84469e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Stephane Caron <stephane.caron@normalesup.org>
#
# 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... | 28.513514 | 74 | 0.703318 |
import pylab
from numpy import fmod, pi, array
def center_angle(theta):
theta = fmod(theta, 2 * pi)
if theta > pi:
return theta - 2 * pi
if theta < -pi:
return theta + 2 * pi
return theta
def center_angle_vect(q):
return array(map(center_angle, q))
def put_symb... | true | true |
1c25e3a0f87ed83d89f29bead2ec60de3a721c6a | 9,761 | py | Python | private/templates/EUROSHA/config.py | andygimma/eden | 716d5e11ec0030493b582fa67d6f1c35de0af50d | [
"MIT"
] | 1 | 2019-08-20T16:32:33.000Z | 2019-08-20T16:32:33.000Z | private/templates/EUROSHA/config.py | andygimma/eden | 716d5e11ec0030493b582fa67d6f1c35de0af50d | [
"MIT"
] | null | null | null | private/templates/EUROSHA/config.py | andygimma/eden | 716d5e11ec0030493b582fa67d6f1c35de0af50d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from gluon import current
from gluon.storage import Storage
from gluon.contrib.simplejson.ordered_dict import OrderedDict
settings = current.deployment_settings
T = current.T
"""
Template settings for EUROSHA: European Open Source Humanitarian Aid
"""
# Pre-Populate
settings.base.prepopul... | 35.886029 | 147 | 0.622989 |
from gluon import current
from gluon.storage import Storage
from gluon.contrib.simplejson.ordered_dict import OrderedDict
settings = current.deployment_settings
T = current.T
settings.base.prepopulate = ["EUROSHA"]
settings.base.system_name = T("EUROSHA Humanitarian Data Registry")
settings.base.system_name_short... | true | true |
1c25e44ac4ccb46be8c3c3ffda23cabebb2a7892 | 381 | py | Python | brownie/simplestorage/scripts/read_value.py | lbhymshr/learn_solidity | cad323de58f01d953a5d51746013adb7f415cf45 | [
"MIT"
] | null | null | null | brownie/simplestorage/scripts/read_value.py | lbhymshr/learn_solidity | cad323de58f01d953a5d51746013adb7f415cf45 | [
"MIT"
] | null | null | null | brownie/simplestorage/scripts/read_value.py | lbhymshr/learn_solidity | cad323de58f01d953a5d51746013adb7f415cf45 | [
"MIT"
] | null | null | null | from brownie import SimpleStorage, accounts, config
def read_contract():
print(SimpleStorage)
print(f"Contract deployed at : {SimpleStorage[0]}")
simple_storage = SimpleStorage[-1] # -1 for the most recent deployment
# Get Application Binary Interface
stored_value = simple_storage.retrieve()
p... | 25.4 | 74 | 0.721785 | from brownie import SimpleStorage, accounts, config
def read_contract():
print(SimpleStorage)
print(f"Contract deployed at : {SimpleStorage[0]}")
simple_storage = SimpleStorage[-1]
stored_value = simple_storage.retrieve()
print(stored_value)
pass
def main():
read_contract()
| true | true |
1c25e4542b5e2dfe221a2c364a9c395e02525cb0 | 3,756 | py | Python | nwu-eecs-339-db/py-btree-lab/btreelab/node.py | mzhang-code/courses | 35672c5355cc10ddebb54d17fb7ccbf0f462be00 | [
"MIT"
] | null | null | null | nwu-eecs-339-db/py-btree-lab/btreelab/node.py | mzhang-code/courses | 35672c5355cc10ddebb54d17fb7ccbf0f462be00 | [
"MIT"
] | null | null | null | nwu-eecs-339-db/py-btree-lab/btreelab/node.py | mzhang-code/courses | 35672c5355cc10ddebb54d17fb7ccbf0f462be00 | [
"MIT"
] | 1 | 2019-11-29T17:49:37.000Z | 2019-11-29T17:49:37.000Z |
import struct
from types import *
from util import IntUtil
class Meta(object):
'''meta format: (n, status, parent/root, order, key_size, val_size)
'''
META_FORMAT = 'i i i i i i'
packer = struct.Struct(META_FORMAT)
size = packer.size
def __init__(self, *args):
self._meta = a... | 25.903448 | 72 | 0.569755 |
import struct
from types import *
from util import IntUtil
class Meta(object):
'''meta format: (n, status, parent/root, order, key_size, val_size)
'''
META_FORMAT = 'i i i i i i'
packer = struct.Struct(META_FORMAT)
size = packer.size
def __init__(self, *args):
self._meta = a... | false | true |
1c25e641338da730c464296d557a1731267b3980 | 545 | py | Python | manage.py | fenilgholani/Suicide-Prevention | 66b017462b20805a281aaa3db0a620aacb02e7c7 | [
"MIT"
] | null | null | null | manage.py | fenilgholani/Suicide-Prevention | 66b017462b20805a281aaa3db0a620aacb02e7c7 | [
"MIT"
] | null | null | null | manage.py | fenilgholani/Suicide-Prevention | 66b017462b20805a281aaa3db0a620aacb02e7c7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoproject.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django... | 34.0625 | 77 | 0.689908 |
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoproject.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's i... | true | true |
1c25e82a79ff7e595189c021aa6eb195c43a1c16 | 6,105 | py | Python | elections_admin/management/commands/load_global.py | newsdev/nyt-elections-admin | 3d19f94f640eafa5e2316d6ef71afcea2ba3bc7a | [
"Apache-2.0"
] | 3 | 2015-10-29T21:26:09.000Z | 2017-12-15T16:36:50.000Z | elections_admin/management/commands/load_global.py | newsdev/nyt-elections-admin | 3d19f94f640eafa5e2316d6ef71afcea2ba3bc7a | [
"Apache-2.0"
] | 6 | 2015-10-29T20:07:20.000Z | 2015-11-06T15:29:05.000Z | elections_admin/management/commands/load_global.py | newsdev/nyt-elections-admin | 3d19f94f640eafa5e2316d6ef71afcea2ba3bc7a | [
"Apache-2.0"
] | 1 | 2019-08-14T20:49:05.000Z | 2019-08-14T20:49:05.000Z | import datetime
import logging
from optparse import make_option
from elex.parser import api
from elex import loader
from elex.loader import postgres
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--date... | 46.25 | 232 | 0.602129 | import datetime
import logging
from optparse import make_option
from elex.parser import api
from elex import loader
from elex.loader import postgres
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--date... | true | true |
1c25e8a64b6e4ea1ae6180cee07844bf6fe03e68 | 4,015 | py | Python | sa/profiles/Eltex/TAU/get_metrics.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | sa/profiles/Eltex/TAU/get_metrics.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | sa/profiles/Eltex/TAU/get_metrics.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ----------------------------------------------------------------------
# Eltex.TAU.get_metrics
# ----------------------------------------------------------------------
# Copyright (C) 2007-2021 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# NOC mo... | 32.379032 | 83 | 0.437609 |
from noc.sa.profiles.Generic.get_metrics import Script as GetMetricsScript, metrics
class Script(GetMetricsScript):
name = "Eltex.TAU.get_metrics"
@metrics(
["CPU | Usage"],
volatile=False,
access="S",
)
def get_cpu_usage(self, metrics):
cpu_usage = self.snmp.g... | true | true |
1c25e8d8cd5debbbfdd90ca2e776b7c478d32122 | 616 | py | Python | lesson_two/views.py | erdyneevzt/courses_django | 8b8baf58f30a4cbf91a46ce3709b87abed70d230 | [
"MIT"
] | null | null | null | lesson_two/views.py | erdyneevzt/courses_django | 8b8baf58f30a4cbf91a46ce3709b87abed70d230 | [
"MIT"
] | null | null | null | lesson_two/views.py | erdyneevzt/courses_django | 8b8baf58f30a4cbf91a46ce3709b87abed70d230 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def home(request):
return HttpResponse("Home Page!")
def items(request):
return HttpResponse("Welcome to localhost/items")
def day_archive(request, year , month, day):
return HttpResponse("Welcome to localh... | 29.333333 | 109 | 0.691558 | from django.shortcuts import render
from django.http import HttpResponse
def home(request):
return HttpResponse("Home Page!")
def items(request):
return HttpResponse("Welcome to localhost/items")
def day_archive(request, year , month, day):
return HttpResponse("Welcome to localhost/items/(?P<year>[\d]{4... | true | true |
1c25e95864c1fb166c8590c947c1e3995175cd4e | 2,809 | py | Python | carball/decompile_replays.py | jawnv6/carball | 9319479e593ebc533a6b05bde7afaec60f805298 | [
"Apache-2.0"
] | null | null | null | carball/decompile_replays.py | jawnv6/carball | 9319479e593ebc533a6b05bde7afaec60f805298 | [
"Apache-2.0"
] | null | null | null | carball/decompile_replays.py | jawnv6/carball | 9319479e593ebc533a6b05bde7afaec60f805298 | [
"Apache-2.0"
] | null | null | null | import json
import os
import subprocess
import logging
import platform as pt
from carball.analysis.analysis_manager import AnalysisManager
from carball.extras.per_goal_analysis import PerGoalAnalysis
from carball.json_parser.sanity_check.sanity_check import SanityChecker
from carball.json_parser.game import Game
from ... | 37.453333 | 112 | 0.727305 | import json
import os
import subprocess
import logging
import platform as pt
from carball.analysis.analysis_manager import AnalysisManager
from carball.extras.per_goal_analysis import PerGoalAnalysis
from carball.json_parser.sanity_check.sanity_check import SanityChecker
from carball.json_parser.game import Game
from ... | true | true |
1c25ea0c78201291e3f371d84fa2bd8197acbeb8 | 16,610 | py | Python | AposSong.py | Apostolique/AposSong | f3449766d7b5d6781ca68ec34b25cc2981338960 | [
"MIT"
] | null | null | null | AposSong.py | Apostolique/AposSong | f3449766d7b5d6781ca68ec34b25cc2981338960 | [
"MIT"
] | 2 | 2018-01-26T08:34:47.000Z | 2021-09-02T20:20:40.000Z | AposSong.py | Apostolique/AposSong | f3449766d7b5d6781ca68ec34b25cc2981338960 | [
"MIT"
] | 3 | 2015-10-31T22:36:21.000Z | 2021-09-02T14:37:21.000Z | import sys
import json
import unicodedata
from PyQt5 import QtGui, QtCore, QtWidgets
class TextSearch:
#Removes accents and lowers the cases.
def normalizeText(self, text):
return ''.join((c for c in unicodedata.normalize('NFD', text) if unicodedata.category(c) != 'Mn')).lower()
def normalStringS... | 36.585903 | 251 | 0.566948 | import sys
import json
import unicodedata
from PyQt5 import QtGui, QtCore, QtWidgets
class TextSearch:
def normalizeText(self, text):
return ''.join((c for c in unicodedata.normalize('NFD', text) if unicodedata.category(c) != 'Mn')).lower()
def normalStringSearch(self, searchString, text):
... | true | true |
1c25ebaf24ae74bc68d02b2ec3489f459a7326c7 | 1,544 | py | Python | scripts/test_check.py | dbmi-bgm/foursight-cgap | 052aac58ed9ac3558d2f50e42a6645fc35bfb2b9 | [
"MIT"
] | null | null | null | scripts/test_check.py | dbmi-bgm/foursight-cgap | 052aac58ed9ac3558d2f50e42a6645fc35bfb2b9 | [
"MIT"
] | 2 | 2021-01-28T21:32:14.000Z | 2021-07-21T14:31:40.000Z | scripts/test_check.py | dbmi-bgm/foursight-cgap | 052aac58ed9ac3558d2f50e42a6645fc35bfb2b9 | [
"MIT"
] | null | null | null | import sys
import datetime
import boto3
import json
import argparse
sys.path.append('..')
import app
from chalicelib.vars import DEV_ENV
EPILOG = __doc__
ENVS = ['cgap']
STAGES = ['dev', 'prod']
def setup_stage(stage):
if not stage:
app.set_stage('dev')
else:
if stage not in STAGES:
... | 23.044776 | 77 | 0.607513 | import sys
import datetime
import boto3
import json
import argparse
sys.path.append('..')
import app
from chalicelib.vars import DEV_ENV
EPILOG = __doc__
ENVS = ['cgap']
STAGES = ['dev', 'prod']
def setup_stage(stage):
if not stage:
app.set_stage('dev')
else:
if stage not in STAGES:
... | true | true |
1c25ec7bd29656a4a92dea4692d43a97210bf301 | 356 | py | Python | thrift/runserver.py | maiqi2016/service | ab489d2869120c8ae069b59feb3ca0ad6a3a4ffb | [
"BSD-3-Clause"
] | 2 | 2017-04-17T11:50:38.000Z | 2018-03-12T03:18:41.000Z | thrift/runserver.py | maiqi2016/service | ab489d2869120c8ae069b59feb3ca0ad6a3a4ffb | [
"BSD-3-Clause"
] | null | null | null | thrift/runserver.py | maiqi2016/service | ab489d2869120c8ae069b59feb3ca0ad6a3a4ffb | [
"BSD-3-Clause"
] | 6 | 2017-04-17T12:27:10.000Z | 2018-03-12T03:18:42.000Z | #!/usr/bin/env python
import BaseHTTPServer
import CGIHTTPServer
import sys
class Handler(CGIHTTPServer.CGIHTTPRequestHandler):
cgi_directories = ['/']
ip = sys.argv[1] if 1 in range(len(sys.argv)) else '192.168.0.222'
port = sys.argv[2] if 2 in range(len(sys.argv)) else '8888'
BaseHTTPServer.HTTPServer((ip, i... | 25.428571 | 67 | 0.733146 |
import BaseHTTPServer
import CGIHTTPServer
import sys
class Handler(CGIHTTPServer.CGIHTTPRequestHandler):
cgi_directories = ['/']
ip = sys.argv[1] if 1 in range(len(sys.argv)) else '192.168.0.222'
port = sys.argv[2] if 2 in range(len(sys.argv)) else '8888'
BaseHTTPServer.HTTPServer((ip, int(port)), Handler).s... | true | true |
1c25ec97beda9e63e2603f168f9560100ee27dbe | 1,482 | py | Python | official/vision/detection/modeling/factory.py | akineeic/models | 2912042352009c9993dc05403624100bfe42d9c1 | [
"Apache-2.0"
] | 15 | 2018-08-15T19:29:39.000Z | 2021-11-05T02:14:59.000Z | official/vision/detection/modeling/factory.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 5 | 2020-10-01T09:02:34.000Z | 2021-02-21T12:50:11.000Z | official/vision/detection/modeling/factory.py | yangxl-2014-fe/models | 11ea5237818e791a5717716d5413977f4c4db1e3 | [
"Apache-2.0"
] | 8 | 2019-06-06T20:37:15.000Z | 2022-03-04T13:54:38.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39 | 80 | 0.727395 |
from official.vision.detection.modeling import maskrcnn_model
from official.vision.detection.modeling import olnmask_model
from official.vision.detection.modeling import retinanet_model
from official.vision.detection.modeling import shapemask_model
def model_generator(params):
if params.type == 'ret... | true | true |
1c25ecbd8ff12f9840881ba8fe02ca47ec592c4c | 1,533 | py | Python | agdc-v2/datacube/scripts/product.py | ceos-seo/Data_Cube_v2 | 81c3be66153ea123b5d21cf9ec7f59ccb7a2050a | [
"Apache-2.0"
] | 27 | 2016-08-16T18:22:47.000Z | 2018-08-25T17:18:15.000Z | agdc-v2/datacube/scripts/product.py | ceos-seo/Data_Cube_v2 | 81c3be66153ea123b5d21cf9ec7f59ccb7a2050a | [
"Apache-2.0"
] | null | null | null | agdc-v2/datacube/scripts/product.py | ceos-seo/Data_Cube_v2 | 81c3be66153ea123b5d21cf9ec7f59ccb7a2050a | [
"Apache-2.0"
] | 27 | 2016-08-26T18:14:40.000Z | 2021-12-24T08:41:29.000Z | from __future__ import absolute_import
import logging
import click
from click import echo
from pathlib import Path
from datacube import Datacube
from datacube.ui import click as ui
from datacube.ui.click import cli
from datacube.utils import read_documents, InvalidDocException
_LOG = logging.getLogger('datacube-pro... | 26.431034 | 89 | 0.638617 | from __future__ import absolute_import
import logging
import click
from click import echo
from pathlib import Path
from datacube import Datacube
from datacube.ui import click as ui
from datacube.ui.click import cli
from datacube.utils import read_documents, InvalidDocException
_LOG = logging.getLogger('datacube-pro... | true | true |
1c25ed058eeb2cd80e71305eaffe92161dc6bb2f | 3,566 | py | Python | light_aligner/align_sents.py | ffreemt/light-aligner | fb1c3f2e7105c9f3ff4f5b3a93b817fd81ca7a9a | [
"MIT"
] | 3 | 2020-08-09T12:58:56.000Z | 2021-08-11T02:08:22.000Z | light_aligner/align_sents.py | ffreemt/light-aligner | fb1c3f2e7105c9f3ff4f5b3a93b817fd81ca7a9a | [
"MIT"
] | null | null | null | light_aligner/align_sents.py | ffreemt/light-aligner | fb1c3f2e7105c9f3ff4f5b3a93b817fd81ca7a9a | [
"MIT"
] | null | null | null | """ align sents. """
from typing import List, Tuple, Optional, Union
import numpy as np
import pandas as pd
from pathlib import Path
from polyglot.text import Text, Detector
from nltk.translate.gale_church import align_blocks
from logzero import logger
from light_aligner.zip_longest_middle import zip_longest_middle... | 28.99187 | 88 | 0.55889 |
from typing import List, Tuple, Optional, Union
import numpy as np
import pandas as pd
from pathlib import Path
from polyglot.text import Text, Detector
from nltk.translate.gale_church import align_blocks
from logzero import logger
from light_aligner.zip_longest_middle import zip_longest_middle
def align_sents(
... | true | true |
1c25ee7116378f63412fb9701e4c596416e17b61 | 5,249 | py | Python | app.py | rawswift/fmwc | e9fbddaa77a61bfba0e55ae799a22a300e41b83f | [
"MIT"
] | 1 | 2015-03-30T02:12:38.000Z | 2015-03-30T02:12:38.000Z | app.py | rawswift/fmwc | e9fbddaa77a61bfba0e55ae799a22a300e41b83f | [
"MIT"
] | null | null | null | app.py | rawswift/fmwc | e9fbddaa77a61bfba0e55ae799a22a300e41b83f | [
"MIT"
] | null | null | null | import datetime
from flask import Flask, render_template, jsonify
from mpd import MPDClient
app = Flask(__name__)
@app.route("/")
def index():
client = MPDClient()
client.connect("localhost", 6600)
# Get song(s) in the playlist
playlist = client.playlistinfo()
# Get current song
current = cl... | 21.690083 | 182 | 0.571728 | import datetime
from flask import Flask, render_template, jsonify
from mpd import MPDClient
app = Flask(__name__)
@app.route("/")
def index():
client = MPDClient()
client.connect("localhost", 6600)
playlist = client.playlistinfo()
current = client.currentsong()
status = client.st... | true | true |
1c25ee7ec473e5b0f8a8c115bb26dc8d25b3d121 | 8,365 | py | Python | frappe/hooks.py | adnanmunir83/frappe | 704834725ab7e8bd8b3b7587d6b6fe834fbe8d14 | [
"MIT"
] | null | null | null | frappe/hooks.py | adnanmunir83/frappe | 704834725ab7e8bd8b3b7587d6b6fe834fbe8d14 | [
"MIT"
] | null | null | null | frappe/hooks.py | adnanmunir83/frappe | 704834725ab7e8bd8b3b7587d6b6fe834fbe8d14 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "frappe"
app_title = "Frappe Framework"
app_publisher = "Frappe Technologies"
app_description = "Full stack web framework with Python, Javascript, MariaDB, Redis, Node"
app_icon = "octicon octicon-circuit-board"
app_color = "o... | 36.85022 | 118 | 0.770592 | from __future__ import unicode_literals
from . import __version__ as app_version
app_name = "frappe"
app_title = "Frappe Framework"
app_publisher = "Frappe Technologies"
app_description = "Full stack web framework with Python, Javascript, MariaDB, Redis, Node"
app_icon = "octicon octicon-circuit-board"
app_color = "o... | true | true |
1c25eef341ba86ac217ef07e6815f7ede8df615f | 3,071 | py | Python | frame/base/parser.py | dingjingmaster/blog_spider | 7a0885bf886166eac0caca4471ee9f6424be2225 | [
"MIT"
] | null | null | null | frame/base/parser.py | dingjingmaster/blog_spider | 7a0885bf886166eac0caca4471ee9f6424be2225 | [
"MIT"
] | null | null | null | frame/base/parser.py | dingjingmaster/blog_spider | 7a0885bf886166eac0caca4471ee9f6424be2225 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.6
# -*- encoding=utf8 -*-
import pyquery
"""
需求字段:
標題、發表日期、分類、標籤、內容、圖片
需要的字段信息
1. 网站根URL
2. 解析器名字
3. 解析器类型
1. PARSER_PASSAGE_URL 文章URL
2. PARSER_PASSAGE_TITLE 文章标题
3. PARSER_PASSAGE_DATE ... | 31.659794 | 71 | 0.552914 |
import pyquery
class Parser(object):
def __init__ (self):
self._webURL = ''
self._parserName = 'base_parser'
def _parser_passage_url (self, doc: str) -> (bool, str):
return
def _parser_passage_title (self, doc: str) -> (bool, str):
return
def _parser_passage_date ... | true | true |
1c25f0080f1d958d3fcb7439ecb9e4e68cb3c3c8 | 566 | py | Python | jobs/migrations/0018_auto_20180705_0352.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | 911 | 2015-01-03T22:16:06.000Z | 2022-03-31T23:56:22.000Z | jobs/migrations/0018_auto_20180705_0352.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | 1,342 | 2015-01-02T16:14:45.000Z | 2022-03-28T08:01:20.000Z | jobs/migrations/0018_auto_20180705_0352.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | 551 | 2015-01-04T02:17:31.000Z | 2022-03-23T11:59:25.000Z | # Generated by Django 2.0.6 on 2018-07-05 03:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jobs', '0017_auto_20180705_0348'),
]
operations = [
migrations.AlterField(
model_name='jobcategory',
name='slug',
... | 23.583333 | 64 | 0.583039 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jobs', '0017_auto_20180705_0348'),
]
operations = [
migrations.AlterField(
model_name='jobcategory',
name='slug',
field=models.SlugField(max_length=200... | true | true |
1c25f053d91c0f08c3153ec9a94959551de830f0 | 1,093 | py | Python | authy/urls.py | FabianMatata/instagram_clone | 6d97c4e99e63b801fe0e8628b9513ecd84121cbd | [
"MIT"
] | null | null | null | authy/urls.py | FabianMatata/instagram_clone | 6d97c4e99e63b801fe0e8628b9513ecd84121cbd | [
"MIT"
] | null | null | null | authy/urls.py | FabianMatata/instagram_clone | 6d97c4e99e63b801fe0e8628b9513ecd84121cbd | [
"MIT"
] | null | null | null | from django.urls import path
from authy.views import UserProfile, Signup, PasswordChange, PasswordChangeDone, EditProfile
from django.contrib.auth import views as authViews
urlpatterns = [
path('profile/edit', EditProfile, name='edit-profile'),
path('signup/', Signup, name='signup'),
pa... | 49.681818 | 122 | 0.732845 | from django.urls import path
from authy.views import UserProfile, Signup, PasswordChange, PasswordChangeDone, EditProfile
from django.contrib.auth import views as authViews
urlpatterns = [
path('profile/edit', EditProfile, name='edit-profile'),
path('signup/', Signup, name='signup'),
pa... | true | true |
1c25f0711767e2fb995dfc56849cc380765b369a | 3,361 | py | Python | realestateproject/realestateproject/settings.py | Griffins-sys254/Django_Real_Estate | 4dd6cc792c2942a90cc29b6f3eebecdb06a2c2bb | [
"MIT"
] | 1 | 2022-02-03T06:09:26.000Z | 2022-02-03T06:09:26.000Z | realestateproject/realestateproject/settings.py | Griffins-sys254/Django_Real_Estate | 4dd6cc792c2942a90cc29b6f3eebecdb06a2c2bb | [
"MIT"
] | null | null | null | realestateproject/realestateproject/settings.py | Griffins-sys254/Django_Real_Estate | 4dd6cc792c2942a90cc29b6f3eebecdb06a2c2bb | [
"MIT"
] | null | null | null | import os
"""
Django settings for realestateproject project.
Generated by 'django-admin startproject' using Django 4.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/setting... | 26.054264 | 91 | 0.702767 | import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-mu575b(yv8_$vv&&5$hgt-f!7n@*_c84_p5z8vu823ah$mfoot'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'dj... | true | true |
1c25f08b18e492bfd206781046d3992e577f3008 | 11,802 | py | Python | take_a_number/views.py | take-a-number/api | fd44f8b328e76511dcb248d330faa1d3faf0ff6f | [
"MIT"
] | 1 | 2019-02-12T16:23:37.000Z | 2019-02-12T16:23:37.000Z | take_a_number/views.py | take-a-number/api | fd44f8b328e76511dcb248d330faa1d3faf0ff6f | [
"MIT"
] | 8 | 2019-02-17T23:06:29.000Z | 2019-02-26T02:53:29.000Z | take_a_number/views.py | take-a-number/api | fd44f8b328e76511dcb248d330faa1d3faf0ff6f | [
"MIT"
] | null | null | null | from django.http import HttpResponse, HttpResponseBadRequest
from typing import Dict
import random
import uuid
from uuid import UUID
import json
from .models import Course
from .utils.class_queue import ClassQueue, QueueMember, QueueTA
office_hours_state: Dict[uuid.UUID, ClassQueue] = {}
def random_join_code() ... | 44.368421 | 108 | 0.674716 | from django.http import HttpResponse, HttpResponseBadRequest
from typing import Dict
import random
import uuid
from uuid import UUID
import json
from .models import Course
from .utils.class_queue import ClassQueue, QueueMember, QueueTA
office_hours_state: Dict[uuid.UUID, ClassQueue] = {}
def random_join_code() ... | true | true |
1c25f2035f106197280810227eaf4674d9bc76fe | 1,752 | py | Python | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/UpdateNavNodeRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/UpdateNavNodeRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/UpdateNavNodeRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.444444 | 66 | 0.753995 |
from aliyunsdkcore.request import RpcRequest
class UpdateNavNodeRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Emr', '2016-04-08', 'UpdateNavNode')
def get_ResourceOwnerId(self):
return self.get_query_params().get('ResourceOwnerId')
def set_ResourceOwnerId(self,Res... | true | true |
1c25f33f414e09a32c72121470d842a7c4e799c6 | 1,916 | py | Python | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt_vmss/lib/models/__init__.py | 0cool321/azure-cli | fd8e6d46d5cee682aff51e262c06bc40c01636ba | [
"MIT"
] | 2 | 2020-07-22T18:53:05.000Z | 2021-09-11T05:52:33.000Z | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt_vmss/lib/models/__init__.py | 0cool321/azure-cli | fd8e6d46d5cee682aff51e262c06bc40c01636ba | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt_vmss/lib/models/__init__.py | 0cool321/azure-cli | fd8e6d46d5cee682aff51e262c06bc40c01636ba | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 31.409836 | 94 | 0.622129 |
from .deployment_vmss import DeploymentVmss
from .template_link import TemplateLink
from .parameters_link import ParametersLink
from .provider_resource_type import ProviderResourceType
from .provider import Provider
from .basic_dependency import BasicDependency
from .dependency import Dependency
from .depl... | true | true |
1c25f4cfe55175ff86b65c220ce983495ad0ec26 | 4,984 | py | Python | nnvm/python/nnvm/_base.py | CynthiaProtector/helo | ad9e22363a92389b3fa519ecae9061c6ead28b05 | [
"Apache-2.0"
] | 22 | 2019-02-20T12:42:20.000Z | 2021-12-25T06:09:46.000Z | src/nnvm/python/nnvm/_base.py | tashby/turicreate | 7f07ce795833d0c56c72b3a1fb9339bed6d178d1 | [
"BSD-3-Clause"
] | 4 | 2019-04-01T07:36:04.000Z | 2022-03-24T03:11:26.000Z | src/nnvm/python/nnvm/_base.py | tashby/turicreate | 7f07ce795833d0c56c72b3a1fb9339bed6d178d1 | [
"BSD-3-Clause"
] | 7 | 2019-03-20T16:04:37.000Z | 2021-04-28T18:40:11.000Z | # coding: utf-8
# pylint: disable=invalid-name, unused-import
""" ctypes library of nnvm and helper functions """
from __future__ import absolute_import
import os
import sys
import ctypes
import numpy as np
from . import libinfo
try:
import tvm
except ImportError:
pass
#----------------------------
# library... | 25.299492 | 81 | 0.626204 |
from __future__ import absolute_import
import os
import sys
import ctypes
import numpy as np
from . import libinfo
try:
import tvm
except ImportError:
pass
if sys.version_info[0] == 3:
string_types = str,
numeric_types = (float, int, np.float32, np.int32)
py_str = lambda x: x.decod... | true | true |
1c25f66e13a2bac0ecdf9ae89fd3d71b3ef3db13 | 161 | py | Python | study/curso-em-video/exercises/015.py | jhonatanmaia/python | d53c64e6bab598c7e85813fd3f107c6f23c1fc46 | [
"MIT"
] | null | null | null | study/curso-em-video/exercises/015.py | jhonatanmaia/python | d53c64e6bab598c7e85813fd3f107c6f23c1fc46 | [
"MIT"
] | null | null | null | study/curso-em-video/exercises/015.py | jhonatanmaia/python | d53c64e6bab598c7e85813fd3f107c6f23c1fc46 | [
"MIT"
] | null | null | null | n13=float(input("Quantos KM o carro andou?: "))
n14=int(input("Quantos dias ele foi alugado?: "))
print("O valor total a pagar é R${}".format(n13*0.15+n14*60.0)) | 53.666667 | 63 | 0.68323 | n13=float(input("Quantos KM o carro andou?: "))
n14=int(input("Quantos dias ele foi alugado?: "))
print("O valor total a pagar é R${}".format(n13*0.15+n14*60.0)) | true | true |
1c25f6f93bc0f06c948c01f93f81560b8bad9be8 | 2,815 | py | Python | TFQ/qosf/gates.py | Project-Fare/quantum_computation | fc182007d0cf7cca170efdbcb442576fde5927ff | [
"MIT"
] | 27 | 2020-04-15T18:45:43.000Z | 2022-03-29T10:28:42.000Z | TFQ/qosf/gates.py | Project-Fare/quantum_computation | fc182007d0cf7cca170efdbcb442576fde5927ff | [
"MIT"
] | 1 | 2021-08-23T01:59:34.000Z | 2021-08-24T05:22:08.000Z | TFQ/qosf/gates.py | Project-Fare/quantum_computation | fc182007d0cf7cca170efdbcb442576fde5927ff | [
"MIT"
] | 10 | 2021-01-30T15:20:36.000Z | 2022-03-29T10:28:51.000Z | import numpy as np
import math
outer_00 = np.array([[1, 0], [0, 0]])
outer_11 = np.array([[0, 0], [0, 1]])
class X(object):
def __init__(self, qubit=None) -> None:
super().__init__()
self.op = np.array([
[0, 1],
[1, 0]
])
self.on = qubit
clas... | 26.809524 | 98 | 0.460746 | import numpy as np
import math
outer_00 = np.array([[1, 0], [0, 0]])
outer_11 = np.array([[0, 0], [0, 1]])
class X(object):
def __init__(self, qubit=None) -> None:
super().__init__()
self.op = np.array([
[0, 1],
[1, 0]
])
self.on = qubit
clas... | true | true |
1c25f757f67ff7c3db5c921cd602337abb16fb72 | 5,898 | py | Python | Lib/site-packages/rest_framework_gis/schema.py | harshapriyag/SDPC-Backend | 6f53049cb4fd932c08c7291ff8285de6ea457fd2 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/rest_framework_gis/schema.py | harshapriyag/SDPC-Backend | 6f53049cb4fd932c08c7291ff8285de6ea457fd2 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/rest_framework_gis/schema.py | harshapriyag/SDPC-Backend | 6f53049cb4fd932c08c7291ff8285de6ea457fd2 | [
"bzip2-1.0.6"
] | null | null | null | import warnings
from django.contrib.gis.db import models
from rest_framework.schemas.openapi import AutoSchema
from rest_framework.utils import model_meta
from rest_framework_gis.fields import GeometrySerializerMethodField
from rest_framework_gis.serializers import (
GeoFeatureModelListSerializer,
GeoFeatureM... | 34.694118 | 98 | 0.571041 | import warnings
from django.contrib.gis.db import models
from rest_framework.schemas.openapi import AutoSchema
from rest_framework.utils import model_meta
from rest_framework_gis.fields import GeometrySerializerMethodField
from rest_framework_gis.serializers import (
GeoFeatureModelListSerializer,
GeoFeatureM... | true | true |
1c25f8ff14f4a1b78d876eee40daa5242fa102ec | 1,799 | py | Python | Learn-Python-The-Hard-Way/Python3/ex03-studydrills.py | QuantFinEcon/py-learn | 7151f01df9f7f096312e43434fe8026d1d7d7828 | [
"Apache-2.0"
] | 2 | 2021-03-07T17:13:49.000Z | 2022-03-29T08:55:17.000Z | Learn-Python-The-Hard-Way/Python3/ex03-studydrills.py | QuantFinEcon/py-learn | 7151f01df9f7f096312e43434fe8026d1d7d7828 | [
"Apache-2.0"
] | 1 | 2021-06-10T20:17:55.000Z | 2021-06-10T20:17:55.000Z | Learn-Python-The-Hard-Way/Python3/ex03-studydrills.py | QuantFinEcon/py-learn | 7151f01df9f7f096312e43434fe8026d1d7d7828 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# ex3: Numbers and Math
# Print "I will now count my chickens:"
print("I will now count my chickens:")
# Print the number of hens
print("Hens", 25 + 30 / 6)
# Print the number of roosters
print("Roosters, 100 -25 * 3 % 4")
# Print "Now I will count the eggs:"
print("Now I will count the eggs:... | 25.7 | 74 | 0.670372 |
print("I will now count my chickens:")
print("Hens", 25 + 30 / 6)
print("Roosters, 100 -25 * 3 % 4")
print("Now I will count the eggs:")
print(3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6)
print("Is it true that 3 + 2 < 5 - 7?")
print(3 + 2 < 5 - 7)
print("What is 3 + 2?", 3 + 2)
print("What is 5 - 7?", 5 - 7)
... | true | true |
1c25f925e0684a978d289cc11267af1dce68788f | 5,360 | py | Python | luks.py | Denkisen/Python-LUKS-wrapper | 8925dbe31742b38c30e599e08a97351025a04f09 | [
"MIT"
] | null | null | null | luks.py | Denkisen/Python-LUKS-wrapper | 8925dbe31742b38c30e599e08a97351025a04f09 | [
"MIT"
] | null | null | null | luks.py | Denkisen/Python-LUKS-wrapper | 8925dbe31742b38c30e599e08a97351025a04f09 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import os
import sys
import subprocess
import getpass
help = """
Help example:
luks.py [op_command] [arguments]
Opperation commands [op_command]:
create [path_to_storage_file] [mount_storage_name] [storage_size_in_GB] [raid_parts_count]
open [path_to_storage_file] [mount_storage_name] [raid_pa... | 35.496689 | 150 | 0.663246 |
import os
import sys
import subprocess
import getpass
help = """
Help example:
luks.py [op_command] [arguments]
Opperation commands [op_command]:
create [path_to_storage_file] [mount_storage_name] [storage_size_in_GB] [raid_parts_count]
open [path_to_storage_file] [mount_storage_name] [raid_parts_count]
clos... | true | true |
1c25f97360146551a4d8a1aeda1652349d6714b0 | 2,763 | py | Python | get_mail_from_teams.py | sreyan-ghosh/parsemail | 6d21425067e2fa03eeabc1496601463d15fe4723 | [
"MIT"
] | 5 | 2021-10-03T16:38:35.000Z | 2021-11-01T16:25:25.000Z | get_mail_from_teams.py | sreyan-ghosh/parsemail | 6d21425067e2fa03eeabc1496601463d15fe4723 | [
"MIT"
] | 11 | 2021-10-03T16:38:26.000Z | 2022-03-09T17:30:47.000Z | get_mail_from_teams.py | sreyan-ghosh/parsemail | 6d21425067e2fa03eeabc1496601463d15fe4723 | [
"MIT"
] | 4 | 2021-10-03T16:38:35.000Z | 2021-11-12T18:33:18.000Z | import os
from MailDeets import MailDeets
from parser import teamsparser
import re
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... | 30.362637 | 92 | 0.617807 | import os
from MailDeets import MailDeets
from parser import teamsparser
import re
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... | true | true |
1c25fa4dfe3e2b612a8b1f7f3355498910816857 | 647 | py | Python | tests/test_cadvisor.py | golovanovsv/ansible-docker | 64cd54a436f561948d06145aa6cc1086f28010fa | [
"MIT"
] | null | null | null | tests/test_cadvisor.py | golovanovsv/ansible-docker | 64cd54a436f561948d06145aa6cc1086f28010fa | [
"MIT"
] | null | null | null | tests/test_cadvisor.py | golovanovsv/ansible-docker | 64cd54a436f561948d06145aa6cc1086f28010fa | [
"MIT"
] | null | null | null | # Disabled. See in ../molecule/default/vars.yml
# import testinfra
# import urllib.request
# from pprint import pprint
# def test_cadvisor_is_running(host):
# assert host.docker("cadvisor").is_running
# def test_cadvisor_is_listening(host):
# assert host.socket("tcp://0.0.0.0:8081").is_listening
# TODO: test /he... | 35.944444 | 92 | 0.721793 | true | true | |
1c25fac71d365a02a655092df18383aa55b3129b | 19,174 | py | Python | .venv/lib/python3.10/site-packages/nltk/inference/nonmonotonic.py | plocandido/docinfrati | ad563c93efed1d6909a7650d299cac9adf8a1348 | [
"MIT"
] | null | null | null | .venv/lib/python3.10/site-packages/nltk/inference/nonmonotonic.py | plocandido/docinfrati | ad563c93efed1d6909a7650d299cac9adf8a1348 | [
"MIT"
] | null | null | null | .venv/lib/python3.10/site-packages/nltk/inference/nonmonotonic.py | plocandido/docinfrati | ad563c93efed1d6909a7650d299cac9adf8a1348 | [
"MIT"
] | null | null | null | # Natural Language Toolkit: Nonmonotonic Reasoning
#
# Author: Daniel H. Garrette <dhgarrette@gmail.com>
#
# Copyright (C) 2001-2022 NLTK Project
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
A module to perform nonmonotonic reasoning. The ideas and demonstrations in
this mod... | 34.117438 | 130 | 0.576249 |
from collections import defaultdict
from functools import reduce
from nltk.inference.api import Prover, ProverCommandDecorator
from nltk.inference.prover9 import Prover9, Prover9Command
from nltk.sem.logic import (
AbstractVariableExpression,
AllExpression,
AndExpression,
Applicatio... | true | true |
1c25fb23d567c1ade2422d2ae7d9b02fcae5daf6 | 1,873 | py | Python | lidar/example.py | swipswaps/lidar | 4da700e04f881d37e82094d0866ee0e9d1731010 | [
"MIT"
] | null | null | null | lidar/example.py | swipswaps/lidar | 4da700e04f881d37e82094d0866ee0e9d1731010 | [
"MIT"
] | null | null | null | lidar/example.py | swipswaps/lidar | 4da700e04f881d37e82094d0866ee0e9d1731010 | [
"MIT"
] | null | null | null | import os
import pkg_resources
import richdem as rd
from filtering import MedianFilter
from filling import ExtractSinks
from slicing import DelineateDepressions
# identify the sample data directory of the package
package_name = 'lidar'
data_dir = pkg_resources.resource_filename(package_name, 'data/')
# use the sample... | 40.717391 | 111 | 0.754405 | import os
import pkg_resources
import richdem as rd
from filtering import MedianFilter
from filling import ExtractSinks
from slicing import DelineateDepressions
package_name = 'lidar'
data_dir = pkg_resources.resource_filename(package_name, 'data/')
in_dem = os.path.join(data_dir, 'dem.tif')
out_dir = os.path.join... | true | true |
1c25fb64ad683b01f30e2dca75e1129fe15fe704 | 48,237 | py | Python | lib/network.py | blondfrogs/electrum | 1ffee267c7f103526f2e0ebeb992bd8b3226365d | [
"MIT"
] | 3 | 2018-09-29T13:50:29.000Z | 2019-05-18T23:09:44.000Z | lib/network.py | blondfrogs/electrum | 1ffee267c7f103526f2e0ebeb992bd8b3226365d | [
"MIT"
] | null | null | null | lib/network.py | blondfrogs/electrum | 1ffee267c7f103526f2e0ebeb992bd8b3226365d | [
"MIT"
] | 5 | 2018-09-29T13:50:34.000Z | 2020-11-21T12:46:41.000Z | # Electrum - Lightweight Bitcoin Client
# Copyright (c) 2011-2016 Thomas Voegtlin
#
# 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 without restriction,
# including without limitation the rig... | 40.33194 | 138 | 0.594709 |
import time
import queue
import os
import stat
import errno
import random
import re
import select
from collections import defaultdict
import threading
import socket
import json
import sys
import dns
import dns.resolver
import socks
from . import util
from . import bitcoin
from .bitcoin import *
... | true | true |
1c25fbcd70b00159af3abbe777b2a65b5889750b | 36,495 | py | Python | tests/test_aea_builder.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | tests/test_aea_builder.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | tests/test_aea_builder.py | devjsc/agents-aea | 872f7b76cbcd33b6c809905c68681790bb93ff2f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | 37.126144 | 141 | 0.684779 |
import os
import re
import sys
from importlib import import_module
from pathlib import Path
from textwrap import dedent, indent
from typing import Collection
from unittest import mock
from unittest.mock import MagicMock, Mock, patch
import pytest
import yaml
from aea.aea import AEA
from aea.aea_buil... | true | true |
1c25fc8db8556975eabfe8d8305c3582195604fb | 2,003 | py | Python | dashboard/app/reviewmodel.py | ryankirkland/voice-of-the-customer | 0214af45cc6aa76bfce64065f07c3f4781ee045e | [
"MIT"
] | null | null | null | dashboard/app/reviewmodel.py | ryankirkland/voice-of-the-customer | 0214af45cc6aa76bfce64065f07c3f4781ee045e | [
"MIT"
] | null | null | null | dashboard/app/reviewmodel.py | ryankirkland/voice-of-the-customer | 0214af45cc6aa76bfce64065f07c3f4781ee045e | [
"MIT"
] | null | null | null | from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import GridSearchCV
from sklearn.decomposition import LatentDirichletAllocation
class ReviewLDA():
def __init__(self, n_components=5, learning_decay=0.7):
self.lda = LatentDirichletAllocation(n_components=n_component... | 35.140351 | 102 | 0.646031 | from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import GridSearchCV
from sklearn.decomposition import LatentDirichletAllocation
class ReviewLDA():
def __init__(self, n_components=5, learning_decay=0.7):
self.lda = LatentDirichletAllocation(n_components=n_component... | true | true |
1c25fd6d0b729337ee368862fbbc1967a71605bb | 6,904 | py | Python | ycm_extra_conf.py | gchangchen/dotfiles | 980c53671b4fcf5702401a0d2b255e3cfe1ccc6e | [
"MIT"
] | null | null | null | ycm_extra_conf.py | gchangchen/dotfiles | 980c53671b4fcf5702401a0d2b255e3cfe1ccc6e | [
"MIT"
] | null | null | null | ycm_extra_conf.py | gchangchen/dotfiles | 980c53671b4fcf5702401a0d2b255e3cfe1ccc6e | [
"MIT"
] | null | null | null | # This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... | 36.146597 | 94 | 0.651796 |
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions th... | true | true |
1c25fec9e8f91b868fcf7705681380b12326370c | 954 | py | Python | FeatureMatching/HomographyReconstruction.py | esch3r/OpenCV-Proj | dfff0b2cd89767781904e150455bd9cdc8faaa9e | [
"MIT"
] | null | null | null | FeatureMatching/HomographyReconstruction.py | esch3r/OpenCV-Proj | dfff0b2cd89767781904e150455bd9cdc8faaa9e | [
"MIT"
] | null | null | null | FeatureMatching/HomographyReconstruction.py | esch3r/OpenCV-Proj | dfff0b2cd89767781904e150455bd9cdc8faaa9e | [
"MIT"
] | null | null | null | import homography
import sfm
import sift
# calibration
k = array ([2394,0,932],[0,2398,628],[0,0,1])
# load images and compute features
im1 = array(Image.open('Building_1.jpg'))
sift.process_image('Building_1.jpg','im1.sift')
l1,d1 = sift.read_features_from_file('im1.sift')
im2 = array(Image.open('Building_1.jpg'... | 25.783784 | 62 | 0.71174 | import homography
import sfm
import sift
k = array ([2394,0,932],[0,2398,628],[0,0,1])
im1 = array(Image.open('Building_1.jpg'))
sift.process_image('Building_1.jpg','im1.sift')
l1,d1 = sift.read_features_from_file('im1.sift')
im2 = array(Image.open('Building_1.jpg'))
sift.process_image('Building_2.jpg','im2.sift... | true | true |
1c25fed653079f3a7a280fc49f0319474a156e60 | 575 | py | Python | blender/arm/logicnode/action_rotate_object.py | DsmMatt/armory | 3fa9321016f6e83b2c1009e5ce220566fb35011e | [
"Zlib"
] | 1 | 2018-12-04T05:33:53.000Z | 2018-12-04T05:33:53.000Z | blender/arm/logicnode/action_rotate_object.py | DsmMatt/armory | 3fa9321016f6e83b2c1009e5ce220566fb35011e | [
"Zlib"
] | null | null | null | blender/arm/logicnode/action_rotate_object.py | DsmMatt/armory | 3fa9321016f6e83b2c1009e5ce220566fb35011e | [
"Zlib"
] | null | null | null | import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class RotateObjectNode(Node, ArmLogicTreeNode):
'''Rotate object node'''
bl_idname = 'LNRotateObjectNode'
bl_label = 'Rotate Object'
bl_icon = 'GAME'
def init(self, context):
sel... | 30.263158 | 56 | 0.702609 | import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class RotateObjectNode(Node, ArmLogicTreeNode):
bl_idname = 'LNRotateObjectNode'
bl_label = 'Rotate Object'
bl_icon = 'GAME'
def init(self, context):
self.inputs.new('ArmNodeSocketAc... | true | true |
1c25ff237759335d63f9f46b56727ca20438aec8 | 2,350 | py | Python | fuel_upgrade_system/fuel_upgrade/fuel_upgrade/pre_upgrade_hooks/from_5_1_to_any_ln_fuelweb_x86_64.py | Zipfer/fuel-web | c6c4032eb6e29474e2be0318349265bdb566454c | [
"Apache-2.0"
] | null | null | null | fuel_upgrade_system/fuel_upgrade/fuel_upgrade/pre_upgrade_hooks/from_5_1_to_any_ln_fuelweb_x86_64.py | Zipfer/fuel-web | c6c4032eb6e29474e2be0318349265bdb566454c | [
"Apache-2.0"
] | null | null | null | fuel_upgrade_system/fuel_upgrade/fuel_upgrade/pre_upgrade_hooks/from_5_1_to_any_ln_fuelweb_x86_64.py | Zipfer/fuel-web | c6c4032eb6e29474e2be0318349265bdb566454c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014 Mirantis, 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 requi... | 37.301587 | 78 | 0.718298 |
import logging
from fuel_upgrade import utils
from fuel_upgrade.engines.docker_engine import DockerUpgrader
from fuel_upgrade.engines.host_system import HostSystemUpgrader
from fuel_upgrade.pre_upgrade_hooks.base import PreUpgradeHookBase
logger = logging.getLogger(__name__)
class AddFuelwebX8664Li... | true | true |
1c26005dabe65182568bdb98f3f5c9b36511ad50 | 2,947 | py | Python | robel/dkitty/__init__.py | dmitrySorokin/robel_env | 9c1c692441164393f0a25df5980ae89047aa7959 | [
"Apache-2.0"
] | null | null | null | robel/dkitty/__init__.py | dmitrySorokin/robel_env | 9c1c692441164393f0a25df5980ae89047aa7959 | [
"Apache-2.0"
] | null | null | null | robel/dkitty/__init__.py | dmitrySorokin/robel_env | 9c1c692441164393f0a25df5980ae89047aa7959 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The ROBEL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 32.744444 | 80 | 0.642687 |
from robel.utils.registration import register
_STAND_EPISODE_LEN = 80
register(
env_id='DKittyStandFixed-v0',
class_path='robel.dkitty.stand:DKittyStandFixed',
max_episode_steps=_STAND_EPISODE_LEN)
register(
env_id='DKittyStandRandom-v0',
class_path='robel.dkitty.stand:DKitt... | true | true |
1c2600d904ad6988becc952561fff46f5855cd37 | 942 | py | Python | usaspending_api/common/validator/utils.py | ststuck/usaspending-api | b13bd5bcba0369ff8512f61a34745626c3969391 | [
"CC0-1.0"
] | 217 | 2016-11-03T17:09:53.000Z | 2022-03-10T04:17:54.000Z | usaspending_api/common/validator/utils.py | ststuck/usaspending-api | b13bd5bcba0369ff8512f61a34745626c3969391 | [
"CC0-1.0"
] | 622 | 2016-09-02T19:18:23.000Z | 2022-03-29T17:11:01.000Z | usaspending_api/common/validator/utils.py | ststuck/usaspending-api | b13bd5bcba0369ff8512f61a34745626c3969391 | [
"CC0-1.0"
] | 93 | 2016-09-07T20:28:57.000Z | 2022-02-25T00:25:27.000Z | def get_model_by_name(models, name):
"""
Little helper function to return a TinyShield model from a list of models
given the model's name. Returns None if the model was not found.
"""
for model in models:
if model.get("name") == name:
return model
return None
def update_mo... | 32.482759 | 113 | 0.677282 | def get_model_by_name(models, name):
for model in models:
if model.get("name") == name:
return model
return None
def update_model_in_list(model_list: list, model_name: str, new_dict: dict, replace: bool = False) -> list:
original_model, index = next((model, i) for i, model in enumerate... | true | true |
1c26014029829750918f50828f7a76b4b96244b2 | 19,255 | py | Python | share/pegasus/htcondor/glite/lsf_status.py | ahnitz/pegasus | e269b460f4d87eb3f3a7e91cd82e2c28fdb55573 | [
"Apache-2.0"
] | 127 | 2015-01-28T19:19:13.000Z | 2022-03-31T05:57:40.000Z | share/pegasus/htcondor/glite/lsf_status.py | ahnitz/pegasus | e269b460f4d87eb3f3a7e91cd82e2c28fdb55573 | [
"Apache-2.0"
] | 14 | 2015-04-15T17:44:20.000Z | 2022-02-22T22:48:49.000Z | share/pegasus/htcondor/glite/lsf_status.py | ahnitz/pegasus | e269b460f4d87eb3f3a7e91cd82e2c28fdb55573 | [
"Apache-2.0"
] | 70 | 2015-01-22T15:20:32.000Z | 2022-02-21T22:50:23.000Z | #!/usr/bin/python3
#
# File: lsf_status.py
#
# Author: George Papadimitriou
# e-mail: georgpap@isi.edu
#
#
"""
Query LSF for the status of a given job
Internally, it creates a cache of the LSF bjobs response and will reuse this
for subsequent queries.
"""
import os
import re
import pwd
import sys
import t... | 34.140071 | 148 | 0.594391 |
"""
Query LSF for the status of a given job
Internally, it creates a cache of the LSF bjobs response and will reuse this
for subsequent queries.
"""
import os
import re
import pwd
import sys
import time
import errno
import fcntl
import random
import struct
import subprocess
import signal
import tempfile
impo... | false | true |
1c26031345f27b0b3c5e8e5821af6ebfe2b2b102 | 466 | py | Python | ex31.py | FernandaMakiHirose/programas-jupyter | 40ebfc820fefceb14293715104641ef184acfff4 | [
"MIT"
] | null | null | null | ex31.py | FernandaMakiHirose/programas-jupyter | 40ebfc820fefceb14293715104641ef184acfff4 | [
"MIT"
] | null | null | null | ex31.py | FernandaMakiHirose/programas-jupyter | 40ebfc820fefceb14293715104641ef184acfff4 | [
"MIT"
] | 1 | 2021-06-09T22:33:11.000Z | 2021-06-09T22:33:11.000Z | # Faça um programa que leia um ângulo qualquer e mostre na tela o valor do seno, cosseno e tangente desse ângulo.
from math import radians, sin, cos, tan
a = float(input('Digite o ângulo que você deseja: '))
s = sin(radians(a))
print('O ângulo de {:.2f} tem SENO de {:.2f}' .format(a, s))
cos = cos(radians(a))
print('O... | 46.6 | 113 | 0.669528 |
from math import radians, sin, cos, tan
a = float(input('Digite o ângulo que você deseja: '))
s = sin(radians(a))
print('O ângulo de {:.2f} tem SENO de {:.2f}' .format(a, s))
cos = cos(radians(a))
print('O ângulo de {:.2f} tem COSSENO de {:.2f}' .format(a, cos))
tan = tan(radians(a))
print('O ângulo de {:.2f} tem TAN... | true | true |
1c260374640f793ebd4f6ced100da1c24d849d44 | 1,261 | py | Python | onadata/libs/profiling/sql.py | childhelpline/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 1 | 2018-07-15T13:13:43.000Z | 2018-07-15T13:13:43.000Z | onadata/libs/profiling/sql.py | aondiaye/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 14 | 2018-07-10T12:48:46.000Z | 2022-03-11T23:24:51.000Z | onadata/libs/profiling/sql.py | aondiaye/myhelpline | d72120ee31b6713cbaec79f299f5ee8bcb7ea429 | [
"BSD-3-Clause"
] | 5 | 2018-07-04T07:59:14.000Z | 2020-01-28T07:50:18.000Z | # -*- coding: utf-8 -*-
"""
SqlTimingMiddleware - log SQL execution times per request.
"""
import logging
from django.db import connection
sql_log = logging.getLogger('sql_logger') # pylint: disable=C0103
totals_log = logging.getLogger('sql_totals_logger') # pylint: disable=C0103
# modified from
# http://johnparso... | 30.756098 | 79 | 0.658208 |
import logging
from django.db import connection
sql_log = logging.getLogger('sql_logger')
totals_log = logging.getLogger('sql_totals_logger')
class SqlTimingMiddleware(object):
def __init__(self, get_response):
self.get_response = get_response
def __call__(self, request):
path_in... | true | true |
1c2603c6600778e187ba9ee4f8a2fd51c399aa6a | 1,745 | py | Python | tests/_async/test_provider.py | zodman/gotrue-py | 2f94bfdbc2cf20ef50ec777bbda03face1da3e85 | [
"MIT"
] | 13 | 2021-10-06T08:50:55.000Z | 2022-03-29T18:21:12.000Z | tests/_async/test_provider.py | zodman/gotrue-py | 2f94bfdbc2cf20ef50ec777bbda03face1da3e85 | [
"MIT"
] | 82 | 2021-09-29T11:50:29.000Z | 2022-03-24T07:27:33.000Z | tests/_async/test_provider.py | zodman/gotrue-py | 2f94bfdbc2cf20ef50ec777bbda03face1da3e85 | [
"MIT"
] | 4 | 2021-09-15T07:33:22.000Z | 2022-01-13T22:53:01.000Z | from typing import AsyncIterable
import pytest
from gotrue import AsyncGoTrueClient
from gotrue.types import Provider
GOTRUE_URL = "http://localhost:9999"
@pytest.fixture(name="client")
async def create_client() -> AsyncIterable[AsyncGoTrueClient]:
async with AsyncGoTrueClient(
url=GOTRUE_URL,
... | 26.439394 | 82 | 0.692837 | from typing import AsyncIterable
import pytest
from gotrue import AsyncGoTrueClient
from gotrue.types import Provider
GOTRUE_URL = "http://localhost:9999"
@pytest.fixture(name="client")
async def create_client() -> AsyncIterable[AsyncGoTrueClient]:
async with AsyncGoTrueClient(
url=GOTRUE_URL,
... | true | true |
1c26049f0205362f8511732a7b214aeba485dc89 | 1,421 | py | Python | nipype/interfaces/cmtk/tests/test_auto_CFFConverter.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | 7 | 2017-02-17T08:54:26.000Z | 2022-03-10T20:57:23.000Z | nipype/interfaces/cmtk/tests/test_auto_CFFConverter.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | 1 | 2016-04-25T15:07:09.000Z | 2016-04-25T15:07:09.000Z | nipype/interfaces/cmtk/tests/test_auto_CFFConverter.py | moloney/nipype | a7a9c85c79cb1412ba03406074f83200447ef50b | [
"Apache-2.0"
] | 2 | 2017-09-23T16:22:00.000Z | 2019-08-01T14:18:52.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..convert import CFFConverter
def test_CFFConverter_inputs():
input_map = dict(
creator=dict(),
data_files=dict(),
description=dict(usedefault=True, ),
email=dict(),
gifti_lab... | 30.891304 | 67 | 0.60943 |
from __future__ import unicode_literals
from ..convert import CFFConverter
def test_CFFConverter_inputs():
input_map = dict(
creator=dict(),
data_files=dict(),
description=dict(usedefault=True, ),
email=dict(),
gifti_labels=dict(),
gifti_surfaces=dict(),
gp... | true | true |
1c2604c3b8a40c17ff7fe6a135ca353a96fa4c22 | 1,363 | py | Python | tests/python/test_internal_func.py | Bl00per72/taichi | fe0ae9afa03f2008534e9b698491be740021d7a7 | [
"MIT"
] | 1 | 2022-02-07T06:34:03.000Z | 2022-02-07T06:34:03.000Z | tests/python/test_internal_func.py | Bl00per72/taichi | fe0ae9afa03f2008534e9b698491be740021d7a7 | [
"MIT"
] | 1 | 2022-01-27T09:15:00.000Z | 2022-01-27T09:15:00.000Z | tests/python/test_internal_func.py | Bl00per72/taichi | fe0ae9afa03f2008534e9b698491be740021d7a7 | [
"MIT"
] | null | null | null | import time
from taichi.lang import impl
import taichi as ti
@ti.test(exclude=[ti.metal, ti.opengl, ti.cuda, ti.vulkan, ti.cc])
def test_basic():
@ti.kernel
def test():
for _ in range(10):
impl.call_internal("do_nothing")
test()
@ti.test(exclude=[ti.metal, ti.opengl, ti.cuda, ti.v... | 19.753623 | 72 | 0.624358 | import time
from taichi.lang import impl
import taichi as ti
@ti.test(exclude=[ti.metal, ti.opengl, ti.cuda, ti.vulkan, ti.cc])
def test_basic():
@ti.kernel
def test():
for _ in range(10):
impl.call_internal("do_nothing")
test()
@ti.test(exclude=[ti.metal, ti.opengl, ti.cuda, ti.v... | true | true |
1c26058726726d9defe47d9b84a8725fdc303d81 | 1,823 | py | Python | src/demo/AttachTexture.py | hjwdzh/FrameNet | fe5cc45148f210ad9a2520a576ad92f5f282ca71 | [
"MIT"
] | 102 | 2019-03-29T12:32:02.000Z | 2022-01-28T11:14:18.000Z | src/demo/AttachTexture.py | hjwdzh/FrameNet | fe5cc45148f210ad9a2520a576ad92f5f282ca71 | [
"MIT"
] | 9 | 2019-10-02T04:40:27.000Z | 2021-12-16T17:50:57.000Z | src/demo/AttachTexture.py | hjwdzh/FrameNet | fe5cc45148f210ad9a2520a576ad92f5f282ca71 | [
"MIT"
] | 11 | 2019-06-22T09:03:01.000Z | 2021-01-20T07:54:30.000Z | import cv2
import skimage.io as sio
import sys
import numpy as np
from visualizer import app
from direction import *
import scipy.misc as misc
import argparse
parser = argparse.ArgumentParser(description='Process saome integers.')
parser.add_argument('--input', type=str, default='selected/0000')
parser.add_argument('-... | 37.979167 | 112 | 0.746572 | import cv2
import skimage.io as sio
import sys
import numpy as np
from visualizer import app
from direction import *
import scipy.misc as misc
import argparse
parser = argparse.ArgumentParser(description='Process saome integers.')
parser.add_argument('--input', type=str, default='selected/0000')
parser.add_argument('-... | true | true |
1c2605a3e8773c0ab560bfa4d368c91ef8141a5a | 2,392 | py | Python | tardis/tardis_portal/tests/test_tasks.py | keithschulze/mytardis | 8ed3562574ce990d42bfe96133185a82c31c27d4 | [
"Apache-2.0"
] | null | null | null | tardis/tardis_portal/tests/test_tasks.py | keithschulze/mytardis | 8ed3562574ce990d42bfe96133185a82c31c27d4 | [
"Apache-2.0"
] | null | null | null | tardis/tardis_portal/tests/test_tasks.py | keithschulze/mytardis | 8ed3562574ce990d42bfe96133185a82c31c27d4 | [
"Apache-2.0"
] | null | null | null | import hashlib
from os import path, urandom
from compare import expect
from django.core.files.base import ContentFile
from django.test import TestCase
from tardis.tardis_portal.models import Experiment, Dataset, DataFile, \
User, UserProfile, DataFileObject, StorageBox
from tardis.tardis_portal.tasks import veri... | 33.690141 | 78 | 0.645903 | import hashlib
from os import path, urandom
from compare import expect
from django.core.files.base import ContentFile
from django.test import TestCase
from tardis.tardis_portal.models import Experiment, Dataset, DataFile, \
User, UserProfile, DataFileObject, StorageBox
from tardis.tardis_portal.tasks import veri... | true | true |
1c2605deef4feb5b35cf0b936b1714a60f7d5520 | 162 | py | Python | hesabres/basics/views/views.py | Sepehr-Al/hesabres | 5a7b9df468a95f1e96d76df136ec15fbbab20bca | [
"MIT"
] | null | null | null | hesabres/basics/views/views.py | Sepehr-Al/hesabres | 5a7b9df468a95f1e96d76df136ec15fbbab20bca | [
"MIT"
] | null | null | null | hesabres/basics/views/views.py | Sepehr-Al/hesabres | 5a7b9df468a95f1e96d76df136ec15fbbab20bca | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return render(request, 'index.html')
| 20.25 | 40 | 0.771605 | from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return render(request, 'index.html')
| true | true |
1c2607a5a230a3ac12d4b605fdcda42d0ea2f0d5 | 11,253 | py | Python | lemur/plugins/lemur_aws/plugin.py | bby-bishopclark/lemur | d60b0c880509361a2d2d7c0f1a878907216a95f5 | [
"Apache-2.0"
] | null | null | null | lemur/plugins/lemur_aws/plugin.py | bby-bishopclark/lemur | d60b0c880509361a2d2d7c0f1a878907216a95f5 | [
"Apache-2.0"
] | null | null | null | lemur/plugins/lemur_aws/plugin.py | bby-bishopclark/lemur | d60b0c880509361a2d2d7c0f1a878907216a95f5 | [
"Apache-2.0"
] | null | null | null | """
.. module: lemur.plugins.lemur_aws.plugin
:platform: Unix
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
Terraform example to setup the destination bucket:
resource "aws_s3_bucket" "certs_log_bucket" {
bucket = "certs-log-acce... | 33.792793 | 124 | 0.594242 | from flask import current_app
from lemur.plugins import lemur_aws as aws
from lemur.plugins.bases import DestinationPlugin, ExportDestinationPlugin, SourcePlugin
from lemur.plugins.lemur_aws import iam, s3, elb, ec2
def get_region_from_dns(dns):
return dns.split('.')[-4]
def format_elb_cipher_policy_v2(policy)... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.