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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70a2bc707361296f106a19a66ca8ea96965d277 | 5,861 | py | Python | favs_v1.py | dostarora97/Twitter-Fav-Media-Scraper | 3fba8d0f882e4b75726beeffdcf069e57544a931 | [
"MIT"
] | null | null | null | favs_v1.py | dostarora97/Twitter-Fav-Media-Scraper | 3fba8d0f882e4b75726beeffdcf069e57544a931 | [
"MIT"
] | null | null | null | favs_v1.py | dostarora97/Twitter-Fav-Media-Scraper | 3fba8d0f882e4b75726beeffdcf069e57544a931 | [
"MIT"
] | null | null | null | import json, base64, requests
from jinja2 import Environment, FileSystemLoader
from pathlib import Path
import webbrowser
import tweepy
import sys
class Twitter:
def __init__(self, auth, Bearer_Token=None):
self.auth = auth
self.Bearer_Token = Bearer_Token
if self.auth is None:
... | 35.737805 | 103 | 0.576693 | import json, base64, requests
from jinja2 import Environment, FileSystemLoader
from pathlib import Path
import webbrowser
import tweepy
import sys
class Twitter:
def __init__(self, auth, Bearer_Token=None):
self.auth = auth
self.Bearer_Token = Bearer_Token
if self.auth is None:
... | true | true |
f70a2d293516b125f2a84d6c3115ac2d0c17eb1b | 20,126 | py | Python | homeassistant/components/group/__init__.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 2 | 2018-02-14T07:29:46.000Z | 2018-02-20T08:15:51.000Z | homeassistant/components/group/__init__.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:43:17.000Z | 2022-03-12T01:01:30.000Z | homeassistant/components/group/__init__.py | veresspeter/home-assistant | a3c22c6eec2c77a28a8fa859e899984269708666 | [
"Apache-2.0"
] | 1 | 2020-04-12T17:17:42.000Z | 2020-04-12T17:17:42.000Z | """
Provide the functionality to group entities.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/group/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant import core as ha
from homeassistant.const import (
ATTR_ENTITY_ID... | 30.915515 | 79 | 0.626851 | import asyncio
import logging
import voluptuous as vol
from homeassistant import core as ha
from homeassistant.const import (
ATTR_ENTITY_ID, CONF_ICON, CONF_NAME, STATE_CLOSED, STATE_HOME,
STATE_NOT_HOME, STATE_OFF, STATE_ON, STATE_OPEN, STATE_LOCKED,
STATE_UNLOCKED, STATE_OK, STATE_PROBLEM, STATE_UNKNOW... | true | true |
f70a2e7f346ccb9b2190e341229230510a747e62 | 15,142 | py | Python | openstack_dashboard/dashboards/project/firewalls/tables.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/firewalls/tables.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/project/firewalls/tables.py | timpricecatalyst/horizon | 8279ae0ed464e62e1c91e78341342160f8a07172 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013, Big Switch Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 37.112745 | 78 | 0.58975 |
import logging
from django.core.urlresolvers import reverse
from django.template import defaultfilters as filters
from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from horizon import exceptions
from horizon ... | true | true |
f70a2ff0fe97cee77266ee49f1205c3ffb0ee1ba | 11,290 | py | Python | strategies/hitoshi.py | Jbuxofplenty/quant | 2ef24012963e9ead6193e0f421c63fb009c78f80 | [
"MIT"
] | null | null | null | strategies/hitoshi.py | Jbuxofplenty/quant | 2ef24012963e9ead6193e0f421c63fb009c78f80 | [
"MIT"
] | null | null | null | strategies/hitoshi.py | Jbuxofplenty/quant | 2ef24012963e9ead6193e0f421c63fb009c78f80 | [
"MIT"
] | null | null | null | from zipline.pipeline import Pipeline
from zipline.api import attach_pipeline, pipeline_output
from zipline.pipeline.data.equity_pricing import USEquityPricing
from zipline.pipeline.data import morningstar
from zipline.pipeline.factors import SimpleMovingAverage, AverageDollarVolume
from zipline.pipeline.filters.mornin... | 31.713483 | 88 | 0.628787 | from zipline.pipeline import Pipeline
from zipline.api import attach_pipeline, pipeline_output
from zipline.pipeline.data.equity_pricing import USEquityPricing
from zipline.pipeline.data import morningstar
from zipline.pipeline.factors import SimpleMovingAverage, AverageDollarVolume
from zipline.pipeline.filters.mornin... | true | true |
f70a302ee61e2a2b81f906bd03d8d41979bc5a07 | 476 | py | Python | client/graphics_settings.py | V1ad0S/splendor-game | 2ea0af6b76decc30573f3f90953b28e6eafd1a00 | [
"BSD-2-Clause"
] | null | null | null | client/graphics_settings.py | V1ad0S/splendor-game | 2ea0af6b76decc30573f3f90953b28e6eafd1a00 | [
"BSD-2-Clause"
] | null | null | null | client/graphics_settings.py | V1ad0S/splendor-game | 2ea0af6b76decc30573f3f90953b28e6eafd1a00 | [
"BSD-2-Clause"
] | null | null | null | FPS = 10
SCREEN_SIZE = (1200, 800)
CARDFIELD_COORDS = [(230, 120), (700, 520)]
BANK_COORDS = [(970, 160), (70, 350)]
BACKGROUND = (140, 122, 230)
WHITE = (255, 255, 255)
GREY = (128, 128, 128)
GREEN = (0, 128, 0)
YELLOW = (180, 180, 0)
BLACK = (0, 0, 0)
COLORS = {
"1": [(53, 59, 72), (47, 54, 64),],
"2": [(245... | 26.444444 | 44 | 0.493697 | FPS = 10
SCREEN_SIZE = (1200, 800)
CARDFIELD_COORDS = [(230, 120), (700, 520)]
BANK_COORDS = [(970, 160), (70, 350)]
BACKGROUND = (140, 122, 230)
WHITE = (255, 255, 255)
GREY = (128, 128, 128)
GREEN = (0, 128, 0)
YELLOW = (180, 180, 0)
BLACK = (0, 0, 0)
COLORS = {
"1": [(53, 59, 72), (47, 54, 64),],
"2": [(245... | true | true |
f70a3034af8425987ad286b9f46e1099208fe785 | 7,746 | py | Python | tests/libs/io_peripherals/test_spi.py | izm51/obniz-python-sdk | 40a738b5fe2c0a415cdc09f46d28c143982bfb07 | [
"MIT"
] | 11 | 2019-03-22T12:02:11.000Z | 2021-01-21T04:57:18.000Z | tests/libs/io_peripherals/test_spi.py | izm51/obniz-python-sdk | 40a738b5fe2c0a415cdc09f46d28c143982bfb07 | [
"MIT"
] | 5 | 2019-03-02T08:28:25.000Z | 2021-02-02T22:06:37.000Z | tests/libs/io_peripherals/test_spi.py | izm51/obniz-python-sdk | 40a738b5fe2c0a415cdc09f46d28c143982bfb07 | [
"MIT"
] | 3 | 2019-07-20T06:55:09.000Z | 2019-12-04T05:05:00.000Z | from time import sleep
import pytest
from ...utils import assert_finished, assert_send, receive_json
class TestPeripheralSPI:
def test_start(self, obniz):
obniz.spi0.start(
{"clk": 0, "frequency": 1000000, "miso": 2, "mode": "master", "mosi": 1}
)
assert_send(obniz, [{"io0":... | 34.274336 | 95 | 0.449781 | from time import sleep
import pytest
from ...utils import assert_finished, assert_send, receive_json
class TestPeripheralSPI:
def test_start(self, obniz):
obniz.spi0.start(
{"clk": 0, "frequency": 1000000, "miso": 2, "mode": "master", "mosi": 1}
)
assert_send(obniz, [{"io0":... | true | true |
f70a32b071692b6617364de30b9da8d0250e8356 | 10,584 | py | Python | data/src/transform.py | cytopia/metrics-server-prom | 3777ba9357bf14538f7608d4a2b877b7d50960a0 | [
"MIT"
] | 25 | 2018-08-20T03:29:45.000Z | 2021-05-23T15:52:38.000Z | data/src/transform.py | LINK-HOPE/metrics-server-prom | 3777ba9357bf14538f7608d4a2b877b7d50960a0 | [
"MIT"
] | 4 | 2019-03-01T03:09:16.000Z | 2020-01-18T14:24:46.000Z | data/src/transform.py | LINK-HOPE/metrics-server-prom | 3777ba9357bf14538f7608d4a2b877b7d50960a0 | [
"MIT"
] | 7 | 2018-08-20T12:45:31.000Z | 2019-12-04T02:16:14.000Z | # -*- coding: utf-8 -*-
'''
Auther: cytopia
License: MIT
Transformer for kubernetes-incubator/metrics-server from json
into Prometheus readable format.
'''
import os
import json
import re
import time
import requests
import subprocess
from flask import Flask
from flask import Response
'''
Globals that specify at wh... | 31.406528 | 112 | 0.590231 |
import os
import json
import re
import time
import requests
import subprocess
from flask import Flask
from flask import Response
PROXY = 'http://127.0.0.1:8080'
URL_NODES = PROXY + '/apis/metrics.k8s.io/v1beta1/nodes'
URL_PODS = PROXY + '/apis/metrics.k8s.io/v1beta1/pods'
def shell_exec(command):
bash = os.... | true | true |
f70a33367f3433244e2fb21596526fdea288e07e | 1,454 | py | Python | projects/g3h2-cc/src/get_places_web_api.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-cc/src/get_places_web_api.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | projects/g3h2-cc/src/get_places_web_api.py | keybrl/xdu-coursework | 9d0e905bef28c18d87d3b97643de0d32f9f08ee0 | [
"MIT"
] | null | null | null | from flask import Flask, request
from hbase_manager import HBaseRecord
import json
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/')
@app.route('/test')
@app.route('/hello')
def hello():
return 'Hello World!'
@app.route('/get_places', methods=['GET', 'POST'])
def get_places():
if ... | 26.925926 | 75 | 0.597662 | from flask import Flask, request
from hbase_manager import HBaseRecord
import json
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
@app.route('/')
@app.route('/test')
@app.route('/hello')
def hello():
return 'Hello World!'
@app.route('/get_places', methods=['GET', 'POST'])
def get_places():
if ... | true | true |
f70a3389e6b510962dd2e9884d65750d6c632971 | 16 | py | Python | projects/aio-pika/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 25 | 2021-10-30T19:54:59.000Z | 2022-03-29T06:11:02.000Z | projects/aio-pika/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 21 | 2021-10-19T01:09:38.000Z | 2022-03-24T16:08:53.000Z | projects/aio-pika/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 3 | 2022-01-25T20:25:13.000Z | 2022-03-08T02:58:50.000Z | import aio_pika
| 8 | 15 | 0.875 | import aio_pika
| true | true |
f70a34b972e266ad9d856336955145e38c0df274 | 5,389 | py | Python | Tests/ML/test_config_helpers.py | csiebler/InnerEye-DeepLearning | e33ec7518803347629b786f64786409e1e2e1be5 | [
"MIT"
] | null | null | null | Tests/ML/test_config_helpers.py | csiebler/InnerEye-DeepLearning | e33ec7518803347629b786f64786409e1e2e1be5 | [
"MIT"
] | null | null | null | Tests/ML/test_config_helpers.py | csiebler/InnerEye-DeepLearning | e33ec7518803347629b786f64786409e1e2e1be5 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 43.813008 | 116 | 0.656523 | from typing import List, Optional
import pytest
import torch
from InnerEye.ML.common import ModelExecutionMode
from InnerEye.ML.config import SegmentationModelBase, equally_weighted_classes
from InnerEye.ML.models.architectures.base_model import BaseSegmentationModel
from Tests.ML.configs.DummyModel import DummyModel... | true | true |
f70a350d94c8f84c2a1a642e7372f88ae185dfa0 | 363 | py | Python | todos/admin.py | DanylovAlex1/TodoList | 8b8d9b1ee3f76759acab6bcbbc5d491606a17d9e | [
"MIT"
] | null | null | null | todos/admin.py | DanylovAlex1/TodoList | 8b8d9b1ee3f76759acab6bcbbc5d491606a17d9e | [
"MIT"
] | 5 | 2021-03-30T14:16:11.000Z | 2021-09-22T19:31:29.000Z | todos/admin.py | DanylovAlex1/TodoList | 8b8d9b1ee3f76759acab6bcbbc5d491606a17d9e | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Board,TodoList
@admin.register(Board)
class BoardAdmin(admin.ModelAdmin):
search_fields = ['title']
list_display = ('title',)
@admin.register(TodoList)
class TodoAdmin(admin.ModelAdmin):
search_fields = ['title','created']
list_display = ('title',... | 21.352941 | 39 | 0.702479 | from django.contrib import admin
from .models import Board,TodoList
@admin.register(Board)
class BoardAdmin(admin.ModelAdmin):
search_fields = ['title']
list_display = ('title',)
@admin.register(TodoList)
class TodoAdmin(admin.ModelAdmin):
search_fields = ['title','created']
list_display = ('title',... | true | true |
f70a3510a892faddda7f081675083673996bcd93 | 49,987 | py | Python | learnpython.py | BoscoDomingo/Learn-Python-in-X-minutes | 10f6a92c1dff93ab9b0702338efba65760e8df5b | [
"CC0-1.0"
] | 2 | 2020-09-23T14:47:25.000Z | 2020-10-01T12:34:57.000Z | learnpython.py | BoscoDomingo/Learn-Python-in-X-minutes | 10f6a92c1dff93ab9b0702338efba65760e8df5b | [
"CC0-1.0"
] | null | null | null | learnpython.py | BoscoDomingo/Learn-Python-in-X-minutes | 10f6a92c1dff93ab9b0702338efba65760e8df5b | [
"CC0-1.0"
] | null | null | null | ####################################################
## 0. Useful stuff about Python
####################################################
# Pyhton Enhancement Proposals, or PEPs, are useful conventions which guide
# the user in writing readable and pretty code, as well as many other
# details about Python. PEP-8 is the... | 33.369159 | 133 | 0.635205 |
""" Multiline strings can be written
using three "s, and are often used
as documentation (docstrings).
"""
type(a_variable) # Used to find out the type of a variable
help(an_object) # Used to print documentation about a class or function (the
# ones written in the triple double-quotes)
... | false | true |
f70a351b09d4a490b7e6481dfa8c3e12bdd186e9 | 685 | py | Python | DBCalls/urls.py | EdgarBodiaj/EMT-Storage | 90c7b42b43c5925bcbb1941412efe0b15fb446f0 | [
"MIT"
] | null | null | null | DBCalls/urls.py | EdgarBodiaj/EMT-Storage | 90c7b42b43c5925bcbb1941412efe0b15fb446f0 | [
"MIT"
] | null | null | null | DBCalls/urls.py | EdgarBodiaj/EMT-Storage | 90c7b42b43c5925bcbb1941412efe0b15fb446f0 | [
"MIT"
] | null | null | null | from django.urls import path
from DBCalls.views import CollectionView, ExhibitView, ModuleView, QuestionView
urlpatterns = [
path('Questions/<str:qID>', QuestionView.as_view(), name='questionview'),
path('Questions/', QuestionView.as_view(), name='questionview'),
path('Modules/<str:mID>', ModuleView.as_vie... | 52.692308 | 79 | 0.706569 | from django.urls import path
from DBCalls.views import CollectionView, ExhibitView, ModuleView, QuestionView
urlpatterns = [
path('Questions/<str:qID>', QuestionView.as_view(), name='questionview'),
path('Questions/', QuestionView.as_view(), name='questionview'),
path('Modules/<str:mID>', ModuleView.as_vie... | true | true |
f70a366b486949f8b542768f83c5593f35c86520 | 735 | py | Python | pytglib/api/functions/cancel_upload_file.py | iTeam-co/pytglib | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 6 | 2019-10-30T08:57:27.000Z | 2021-02-08T14:17:43.000Z | pytglib/api/functions/cancel_upload_file.py | iTeam-co/python-telegram | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 1 | 2021-08-19T05:44:10.000Z | 2021-08-19T07:14:56.000Z | pytglib/api/functions/cancel_upload_file.py | iTeam-co/python-telegram | e5e75e0a85f89b77762209b32a61b0a883c0ae61 | [
"MIT"
] | 5 | 2019-12-04T05:30:39.000Z | 2021-05-21T18:23:32.000Z |
from ..utils import Object
class CancelUploadFile(Object):
"""
Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined
Attributes:
ID (:obj:`str`): ``CancelUploadFile``
Args:
file_id (:obj:`int`):
... | 22.272727 | 132 | 0.614966 |
from ..utils import Object
class CancelUploadFile(Object):
ID = "cancelUploadFile"
def __init__(self, file_id, extra=None, **kwargs):
self.extra = extra
self.file_id = file_id
@staticmethod
def read(q: dict, *args) -> "CancelUploadFile":
file_id = q.get('file_id')
... | true | true |
f70a38fcf4fc8f443b09e280076b04f3e02c71ef | 1,359 | py | Python | var/spack/repos/builtin/packages/cblas/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-10T13:47:48.000Z | 2019-04-17T13:05:17.000Z | var/spack/repos/builtin/packages/cblas/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | var/spack/repos/builtin/packages/cblas/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-04-07T18:27:09.000Z | 2022-03-31T22:52:38.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Cblas(Package):
"""The BLAS (Basic Linear Algebra Subprograms) are routines that
pr... | 33.975 | 100 | 0.647535 |
from spack import *
class Cblas(Package):
homepage = "http://www.netlib.org/blas/_cblas/"
version('2015-06-06', sha256='0f6354fd67fabd909baf57ced2ef84e962db58fae126e4f41b21dd4fec60a2a3',
url='http://www.netlib.org/blas/blast-forum/cblas.tgz')
depends_on('blas')
parallel = False
... | true | true |
f70a3adb0d09aaaa54de4dcfc4ac9602759c5e44 | 8,766 | py | Python | src/oauth/views.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 18 | 2021-05-20T13:20:16.000Z | 2022-02-11T02:40:18.000Z | src/oauth/views.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 109 | 2021-05-21T20:14:23.000Z | 2022-03-31T20:56:10.000Z | src/oauth/views.py | ResearchHub/ResearchHub-Backend-Open | d36dca33afae2d442690694bb2ab17180d84bcd3 | [
"MIT"
] | 4 | 2021-05-17T13:47:53.000Z | 2022-02-12T10:48:21.000Z | import requests
from allauth.socialaccount.helpers import render_authentication_error
from allauth.socialaccount.models import SocialLogin, SocialAccount
from allauth.socialaccount.providers.base import ProviderException
from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
from allauth.socialac... | 32.708955 | 77 | 0.671344 | import requests
from allauth.socialaccount.helpers import render_authentication_error
from allauth.socialaccount.models import SocialLogin, SocialAccount
from allauth.socialaccount.providers.base import ProviderException
from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
from allauth.socialac... | true | true |
f70a3b29166669d3eedb262309f7bbc995dcd9f8 | 5,438 | py | Python | httphoneypot/tcp_handler.py | muratti66/python-honeypots | ce3d4f8dcb36c29e6fab00bd8a93ba2de0dfc108 | [
"MIT"
] | null | null | null | httphoneypot/tcp_handler.py | muratti66/python-honeypots | ce3d4f8dcb36c29e6fab00bd8a93ba2de0dfc108 | [
"MIT"
] | 1 | 2021-09-18T00:11:46.000Z | 2021-09-18T00:13:04.000Z | httphoneypot/tcp_handler.py | muratti66/python-honeypots | ce3d4f8dcb36c29e6fab00bd8a93ba2de0dfc108 | [
"MIT"
] | 1 | 2021-05-06T21:11:27.000Z | 2021-05-06T21:11:27.000Z | import socket # Networking support
import time # Current time
from library import id_generate
host = None
port = None
log_th = None
conf_th = None
header_th = None
command_w_th = None
data_w_th = None
class HTTPServer:
def __init__(self):
global host, port, log_th, conf_th, header_th, command_w_th, da... | 39.405797 | 113 | 0.610886 | import socket import time
from library import id_generate
host = None
port = None
log_th = None
conf_th = None
header_th = None
command_w_th = None
data_w_th = None
class HTTPServer:
def __init__(self):
global host, port, log_th, conf_th, header_th, command_w_th, data_w_th
self.host = host
... | true | true |
f70a3b7d8b4bc2d328e9192f92e41eb807c618df | 1,328 | py | Python | dwellingplace/tests/test_models_utils.py | dwelling-place/xlsx-merger | fa2343a3acbf3fc7f8b76b30f6ccbc7dc03282ed | [
"MIT"
] | null | null | null | dwellingplace/tests/test_models_utils.py | dwelling-place/xlsx-merger | fa2343a3acbf3fc7f8b76b30f6ccbc7dc03282ed | [
"MIT"
] | 56 | 2016-11-05T01:55:22.000Z | 2016-11-07T00:30:10.000Z | dwellingplace/tests/test_models_utils.py | dwelling-place/xlsx-merger | fa2343a3acbf3fc7f8b76b30f6ccbc7dc03282ed | [
"MIT"
] | 2 | 2016-11-05T13:42:53.000Z | 2016-11-05T13:59:09.000Z | # pylint: disable=unused-argument,unused-variable,expression-not-assigned
import os
from datetime import datetime
import pytest
from expecter import expect
import xlrd
from dwellingplace.models._utils import parse_xlsx_into_dicts, get_value
DATA = os.path.join(os.path.dirname(__file__), "data")
def test_load():
... | 25.538462 | 73 | 0.614458 |
import os
from datetime import datetime
import pytest
from expecter import expect
import xlrd
from dwellingplace.models._utils import parse_xlsx_into_dicts, get_value
DATA = os.path.join(os.path.dirname(__file__), "data")
def test_load():
xl = xlrd.open_workbook(os.path.join(DATA, 'sample.xlsx'))
output =... | true | true |
f70a3c094cf154b93d675ca8458f3581ca522c8f | 2,286 | py | Python | tests/test_cdkitchen.py | thomascaillier/recipe-scrapers | 564940c0a588bb34455af499754b1be46d690c7b | [
"MIT"
] | 1 | 2021-02-07T17:48:09.000Z | 2021-02-07T17:48:09.000Z | tests/test_cdkitchen.py | thomascaillier/recipe-scrapers | 564940c0a588bb34455af499754b1be46d690c7b | [
"MIT"
] | null | null | null | tests/test_cdkitchen.py | thomascaillier/recipe-scrapers | 564940c0a588bb34455af499754b1be46d690c7b | [
"MIT"
] | null | null | null | from tests import ScraperTest
from recipe_scrapers.cdkitchen import CdKitchen
class TestCdKitchen(ScraperTest):
scraper_class = CdKitchen
def test_host(self):
self.assertEqual("cdkitchen.com", self.harvester_class.host())
def test_canonical_url(self):
self.assertEqual(
... | 41.563636 | 548 | 0.635171 | from tests import ScraperTest
from recipe_scrapers.cdkitchen import CdKitchen
class TestCdKitchen(ScraperTest):
scraper_class = CdKitchen
def test_host(self):
self.assertEqual("cdkitchen.com", self.harvester_class.host())
def test_canonical_url(self):
self.assertEqual(
... | true | true |
f70a3c5c50783abc4ba51130c8dd1408e60f7f6c | 157 | py | Python | boa3_test/test_sc/list_test/AppendAnyValue.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/list_test/AppendAnyValue.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/list_test/AppendAnyValue.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from typing import Any, List
from boa3.builtin import public
@public
def Main() -> List[Any]:
a: List[Any] = [1, 2, 3]
a.append('4')
return a
| 14.272727 | 31 | 0.611465 | from typing import Any, List
from boa3.builtin import public
@public
def Main() -> List[Any]:
a: List[Any] = [1, 2, 3]
a.append('4')
return a
| true | true |
f70a3f7b6707ea59fcb33953a4b50ce4c44c13b1 | 1,245 | py | Python | discordbot/economy/currencies.py | elan17/GamestonkTerminal | f958f8275dc15ffaf30c1f0652f5b033725b7f10 | [
"MIT"
] | 1,835 | 2021-05-09T02:55:06.000Z | 2022-03-29T12:37:05.000Z | discordbot/economy/currencies.py | elan17/GamestonkTerminal | f958f8275dc15ffaf30c1f0652f5b033725b7f10 | [
"MIT"
] | 569 | 2021-05-09T15:59:41.000Z | 2022-03-29T12:25:16.000Z | discordbot/economy/currencies.py | elan17/GamestonkTerminal | f958f8275dc15ffaf30c1f0652f5b033725b7f10 | [
"MIT"
] | 268 | 2021-05-10T21:46:50.000Z | 2022-03-28T09:18:38.000Z | import discord
from gamestonk_terminal.economy import wsj_model
import discordbot.config_discordbot as cfg
from discordbot.run_discordbot import logger
async def currencies_command(ctx):
"""Currencies overview [Wall St. Journal]"""
try:
# Retrieve data
df_data = wsj_model.global_currencies(... | 24.9 | 72 | 0.583936 | import discord
from gamestonk_terminal.economy import wsj_model
import discordbot.config_discordbot as cfg
from discordbot.run_discordbot import logger
async def currencies_command(ctx):
try:
df_data = wsj_model.global_currencies()
if cfg.DEBUG:
logger.debug(df_data... | true | true |
f70a3fdda0f1ba058b58e70b31982a27c4121cac | 1,039 | py | Python | magnumclient/v1/stats_shell.py | gyliu513/python-magnumclient | c0d368360831cd29affa47e77eba4e81e4c6f0f8 | [
"Apache-2.0"
] | 29 | 2015-04-17T12:06:04.000Z | 2019-05-03T06:27:17.000Z | magnumclient/v1/stats_shell.py | gyliu513/python-magnumclient | c0d368360831cd29affa47e77eba4e81e4c6f0f8 | [
"Apache-2.0"
] | 2 | 2016-01-19T14:45:58.000Z | 2016-11-17T16:30:18.000Z | magnumclient/v1/stats_shell.py | gyliu513/python-magnumclient | c0d368360831cd29affa47e77eba4e81e4c6f0f8 | [
"Apache-2.0"
] | 26 | 2015-08-17T19:28:56.000Z | 2020-07-10T08:12:07.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 34.633333 | 78 | 0.696824 |
from magnumclient.common import cliutils as utils
from magnumclient.i18n import _
@utils.arg('--project-id',
required=False,
metavar='<project-id>',
help=_('Project ID'))
@utils.deprecated(utils.MAGNUM_CLIENT_DEPRECATION_WARNING)
def do_stats_list(cs, args):
opts = {
'pro... | true | true |
f70a413c4399a3a45411b582acef1ae95872414b | 4,704 | py | Python | save_features.py | Codelegant92/STC-ProtoNet | f3e77bb1b363b0338cda6f1701bfabe0cd3accbe | [
"MIT"
] | null | null | null | save_features.py | Codelegant92/STC-ProtoNet | f3e77bb1b363b0338cda6f1701bfabe0cd3accbe | [
"MIT"
] | null | null | null | save_features.py | Codelegant92/STC-ProtoNet | f3e77bb1b363b0338cda6f1701bfabe0cd3accbe | [
"MIT"
] | null | null | null | import numpy as np
import torch
from torch.autograd import Variable
import os
import glob
import h5py
import configs
import backbone
from data.datamgr import SimpleDataManager
from methods.baselinetrain import BaselineTrain
from methods.baselinefinetune import BaselineFinetune
from methods.protonet import ProtoNet
fro... | 39.864407 | 191 | 0.6554 | import numpy as np
import torch
from torch.autograd import Variable
import os
import glob
import h5py
import configs
import backbone
from data.datamgr import SimpleDataManager
from methods.baselinetrain import BaselineTrain
from methods.baselinefinetune import BaselineFinetune
from methods.protonet import ProtoNet
fro... | true | true |
f70a42127de469f4bdda2525a0f76c5003a06eef | 10,055 | py | Python | contrib/spendfrom/spendfrom.py | wargo32/NewYorkCoin | f057bd7649ea2512aab427bb3f3cdd014de68fa1 | [
"MIT"
] | 2 | 2018-02-07T15:48:59.000Z | 2022-02-15T23:16:17.000Z | contrib/spendfrom/spendfrom.py | wargo32/NewYorkCoin | f057bd7649ea2512aab427bb3f3cdd014de68fa1 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | wargo32/NewYorkCoin | f057bd7649ea2512aab427bb3f3cdd014de68fa1 | [
"MIT"
] | 3 | 2015-01-26T17:07:07.000Z | 2022-02-15T23:19:06.000Z | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | 37.518657 | 111 | 0.632322 |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis... | true | true |
f70a42ac70d545eee6852b70f3027dbfa760d2d2 | 1,054 | py | Python | unicodeit/export_data.py | TWolczanski/unicodeit | 0c5e616d8dd494db3f9b7dcb3981b47da79d4f80 | [
"LPPL-1.3c",
"MIT"
] | null | null | null | unicodeit/export_data.py | TWolczanski/unicodeit | 0c5e616d8dd494db3f9b7dcb3981b47da79d4f80 | [
"LPPL-1.3c",
"MIT"
] | null | null | null | unicodeit/export_data.py | TWolczanski/unicodeit | 0c5e616d8dd494db3f9b7dcb3981b47da79d4f80 | [
"LPPL-1.3c",
"MIT"
] | null | null | null | import sys
from .data import REPLACEMENTS, COMBININGMARKS, SUBSUPERSCRIPTS
if __name__ == "__main__":
outname = 'ts_src/data.ts'
if len(sys.argv) == 2:
outname = sys.argv[1]
with open(outname, 'w') as f:
f.write('// autogenerated with python -m unicodeit.export_data\n\n')
f.writ... | 31.939394 | 81 | 0.468691 | import sys
from .data import REPLACEMENTS, COMBININGMARKS, SUBSUPERSCRIPTS
if __name__ == "__main__":
outname = 'ts_src/data.ts'
if len(sys.argv) == 2:
outname = sys.argv[1]
with open(outname, 'w') as f:
f.write('// autogenerated with python -m unicodeit.export_data\n\n')
f.writ... | true | true |
f70a42c5e95c543c5c1c2d154ee73266e8144626 | 1,415 | py | Python | tests/pkplatform_test.py | radiasoft/pykern | bf5946e20d77d13ceab387c33ac75c59b6579de6 | [
"Apache-2.0"
] | 8 | 2016-10-26T13:23:44.000Z | 2022-03-02T22:03:01.000Z | tests/pkplatform_test.py | radiasoft/pykern | bf5946e20d77d13ceab387c33ac75c59b6579de6 | [
"Apache-2.0"
] | 124 | 2016-03-01T15:32:54.000Z | 2022-03-31T17:42:40.000Z | tests/pkplatform_test.py | radiasoft/pykern | bf5946e20d77d13ceab387c33ac75c59b6579de6 | [
"Apache-2.0"
] | 10 | 2015-05-09T14:17:36.000Z | 2020-02-10T18:42:53.000Z | # -*- coding: utf-8 -*-
u"""pytest for `pykern.pkplatform`
:copyright: Copyright (c) 2015 Bivio Software, Inc. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
def test_conformance1():
"""Verify the p... | 33.690476 | 73 | 0.671378 | from __future__ import absolute_import, division, print_function
import pytest
def test_conformance1():
import re
import sys
import platform
from pykern import pkplatform
if platform.system() == 'Linux':
assert pkplatform.is_linux()
assert pkplatform.is_unix()
assert not pk... | true | true |
f70a43d947ac006e0f9243ec8a817607c8cc6d8c | 61,521 | py | Python | skyportal/tests/api/test_photometry.py | LSSTDESC/skyportal | 1a433aae67b26ffd3516e65e0fdbf866b4751486 | [
"BSD-3-Clause"
] | null | null | null | skyportal/tests/api/test_photometry.py | LSSTDESC/skyportal | 1a433aae67b26ffd3516e65e0fdbf866b4751486 | [
"BSD-3-Clause"
] | null | null | null | skyportal/tests/api/test_photometry.py | LSSTDESC/skyportal | 1a433aae67b26ffd3516e65e0fdbf866b4751486 | [
"BSD-3-Clause"
] | null | null | null | import math
import numpy as np
import sncosmo
from baselayer.app.env import load_env
from skyportal.models import DBSession, Token
from skyportal.tests import api
_, cfg = load_env()
PHOT_DETECTION_THRESHOLD = cfg["misc.photometry_detection_threshold_nsigma"]
def test_token_user_post_get_photometry_data(
uploa... | 28.117459 | 106 | 0.508087 | import math
import numpy as np
import sncosmo
from baselayer.app.env import load_env
from skyportal.models import DBSession, Token
from skyportal.tests import api
_, cfg = load_env()
PHOT_DETECTION_THRESHOLD = cfg["misc.photometry_detection_threshold_nsigma"]
def test_token_user_post_get_photometry_data(
uploa... | true | true |
f70a4532147a8e522aa5d500dd931c3e3804b846 | 573 | py | Python | 61. Rotate List.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | 61. Rotate List.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | 61. Rotate List.py | XinchaoGou/MyLeetCode | bba0ab077374f7da2cb1a990266bc59fa7ddf23c | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def rotateRight(self, head: ListNode, k: int) -> ListNode:
if not (head and head.next and k) :
return head
fast = head
cnt = 1
whi... | 26.045455 | 62 | 0.518325 | class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def rotateRight(self, head: ListNode, k: int) -> ListNode:
if not (head and head.next and k) :
return head
fast = head
cnt = 1
while fast.next:
fast = fast... | true | true |
f70a459630f112b441d070f0a66321d5095da078 | 524 | py | Python | src/python/pants/backend/python/tasks2/select_interpreter.py | oseemann/pants | 628c83d5ab2706b0f64d69568c57a718ec7c5e2a | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks2/select_interpreter.py | oseemann/pants | 628c83d5ab2706b0f64d69568c57a718ec7c5e2a | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/tasks2/select_interpreter.py | oseemann/pants | 628c83d5ab2706b0f64d69568c57a718ec7c5e2a | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.p... | 34.933333 | 93 | 0.780534 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.python.tasks import SelectInterpreter
from pants.base.deprecated import deprecated_module
deprecated_module('1.7.0.dev0', 'Use pants.backend.pyth... | true | true |
f70a46062b1e1e15ef57f684873bcfe3c44c06da | 1,117 | py | Python | sources/table-maker.py | Nemo-Nowane/math-tools | b3518a309ec9cb137ff3e48e0384172243cf0a5f | [
"MIT"
] | 2 | 2019-11-12T16:47:57.000Z | 2019-11-12T16:47:59.000Z | sources/table-maker.py | Nemo-Nowane/math-tools | b3518a309ec9cb137ff3e48e0384172243cf0a5f | [
"MIT"
] | null | null | null | sources/table-maker.py | Nemo-Nowane/math-tools | b3518a309ec9cb137ff3e48e0384172243cf0a5f | [
"MIT"
] | null | null | null | import sys #For CLI input
from decimal import Decimal, getcontext
"""I wanted to avoid importing this module but, the floats were messing up like
>>> 1-0.8
0.19999999999999996
So, I used it. Round function could helped. But using that produce -0.000, which seemed unaesthetic to me."""
getcontext().prec= 3 #Useless, si... | 38.517241 | 137 | 0.666965 | import sys from decimal import Decimal, getcontext
getcontext().prec= 3 inputlist = list(map(float,sys.argv[1:]))u = inputlist.pop(-3)v = inputlist.pop(-2) s = inputlist.pop(-1) def table (start, end, step, coefficient_list):
y = 0
xlist=[]
fxlist=[]
x = start
while start<= x and x<= end:
for j in ... | true | true |
f70a4626dec6d64168d77420b7c15b1bac91957f | 2,549 | py | Python | src/adventofcode2020/solutions/day02.py | RoelAdriaans/adventofcode2020 | e111c9fee52da6866f7b8b09a7e9c0fea8cc043e | [
"MIT"
] | 2 | 2020-12-01T07:58:31.000Z | 2020-12-02T10:27:07.000Z | src/adventofcode2020/solutions/day02.py | RoelAdriaans/adventofcode2020 | e111c9fee52da6866f7b8b09a7e9c0fea8cc043e | [
"MIT"
] | 57 | 2020-12-04T15:58:46.000Z | 2022-03-31T04:08:01.000Z | src/adventofcode2020/solutions/day02.py | RoelAdriaans/adventofcode2020 | e111c9fee52da6866f7b8b09a7e9c0fea8cc043e | [
"MIT"
] | null | null | null | import re
from typing import NamedTuple
from adventofcode2020.utils.abstract import FileReaderSolution
class PassPol(NamedTuple):
at_least: int
at_most: int
letter: str
password: str
class Day02:
@staticmethod
def split(input_password) -> PassPol:
"""
Input `7-9 r: rrrkrrrrr... | 28.640449 | 88 | 0.587681 | import re
from typing import NamedTuple
from adventofcode2020.utils.abstract import FileReaderSolution
class PassPol(NamedTuple):
at_least: int
at_most: int
letter: str
password: str
class Day02:
@staticmethod
def split(input_password) -> PassPol:
results = re.match(r"(\d*)-(\d*) (.... | true | true |
f70a4652ff4811a1690ee2590252d416d5140e59 | 253 | py | Python | Ex02.py | RODRIGOKTK/Python-exercicios | f7985f2c277aae8b158bdeea4f2493febaaf06c5 | [
"Unlicense"
] | null | null | null | Ex02.py | RODRIGOKTK/Python-exercicios | f7985f2c277aae8b158bdeea4f2493febaaf06c5 | [
"Unlicense"
] | null | null | null | Ex02.py | RODRIGOKTK/Python-exercicios | f7985f2c277aae8b158bdeea4f2493febaaf06c5 | [
"Unlicense"
] | null | null | null | # Escreva um programa que leia um valor em metros e o exiba convertido em milímetros
n1=int(input('Coloque o(s) valor(es): '))
print ('O valor em metros: ', n1)
print ('O valore em centimetros: ', n1 * 100)
print ('O valor em milimetros: ', n1*1000) | 50.6 | 85 | 0.687747 | n1=int(input('Coloque o(s) valor(es): '))
print ('O valor em metros: ', n1)
print ('O valore em centimetros: ', n1 * 100)
print ('O valor em milimetros: ', n1*1000) | true | true |
f70a469dab614ac4ee0bb8cf077e95026dc130fb | 3,201 | py | Python | mars/services/cluster/worker/locator.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 2,413 | 2018-12-06T09:37:11.000Z | 2022-03-30T15:47:39.000Z | mars/services/cluster/worker/locator.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 1,335 | 2018-12-07T03:06:18.000Z | 2022-03-31T11:45:57.000Z | mars/services/cluster/worker/locator.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 329 | 2018-12-07T03:12:41.000Z | 2022-03-29T21:49:57.000Z | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.566265 | 85 | 0.663855 |
import logging
from typing import List
from .... import oscar as mo
from ..core import NodeRole, NodeStatus
from ..locator import SupervisorLocatorActor
logger = logging.getLogger(__name__)
class WorkerSupervisorLocatorActor(SupervisorLocatorActor):
_node_role = NodeRole.WORKER
def __init__(self, *args, *... | true | true |
f70a497308aed482c7aaf58eb8e46ae4b8a07125 | 1,869 | py | Python | feature_extraction/other_features.py | smolendawid/ubaar-competition | 28de972d6beb13343c537fc030101be672a852a3 | [
"Apache-2.0"
] | null | null | null | feature_extraction/other_features.py | smolendawid/ubaar-competition | 28de972d6beb13343c537fc030101be672a852a3 | [
"Apache-2.0"
] | null | null | null | feature_extraction/other_features.py | smolendawid/ubaar-competition | 28de972d6beb13343c537fc030101be672a852a3 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from sklearn.preprocessing import LabelEncoder
def categorical_features(data, features):
features['vehicleType'] = data['vehicleType']
features['vehicleOption'] = data['vehicleOption']
features['vehicleTypeOption'] = [a + '_' + b for a, b in zip(data['vehicleType'].values,
... | 39.765957 | 101 | 0.657036 | import pandas as pd
from sklearn.preprocessing import LabelEncoder
def categorical_features(data, features):
features['vehicleType'] = data['vehicleType']
features['vehicleOption'] = data['vehicleOption']
features['vehicleTypeOption'] = [a + '_' + b for a, b in zip(data['vehicleType'].values,
... | true | true |
f70a4a0a16f7da68ca08d7e7084d6510f50b54c1 | 324 | py | Python | pirates/minigame/DistributedLockAI.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 81 | 2018-04-08T18:14:24.000Z | 2022-01-11T07:22:15.000Z | pirates/minigame/DistributedLockAI.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 4 | 2018-09-13T20:41:22.000Z | 2022-01-08T06:57:00.000Z | pirates/minigame/DistributedLockAI.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 26 | 2018-05-26T12:49:27.000Z | 2021-09-11T09:11:59.000Z | from direct.distributed.DistributedObjectAI import DistributedObjectAI
from direct.directnotify import DirectNotifyGlobal
class DistributedLockAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedLockAI')
def __init__(self, air):
DistributedObjectAI.__init__(self, ... | 40.5 | 77 | 0.82716 | from direct.distributed.DistributedObjectAI import DistributedObjectAI
from direct.directnotify import DirectNotifyGlobal
class DistributedLockAI(DistributedObjectAI):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedLockAI')
def __init__(self, air):
DistributedObjectAI.__init__(self, ... | true | true |
f70a4a6c1279c72c79f69db92d9b3c7c9e801c66 | 258,530 | py | Python | instances/passenger_demand/pas-20210422-1717-int4e-1/60.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int4e-1/60.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210422-1717-int4e-1/60.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 7667
passenger_arriving = (
(2, 0, 1, 3, 1, 1, 2, 1, 0, 1, 0, 0, 0, 3, 1, 3, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0), # 0
(2, 2, 4, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 4, 6, 1, 2, 3, 0, 1, 1, 1, 0, 0, 0, 0), # 1
(2, 2, 3, 3, 0, 2, 0, 1, 1, 0, 1, 0, 0, 2, 1, 4, 2, 2, 0, 3, 1, 1, 0, 0, 1, 0), #... | 276.502674 | 500 | 0.76976 |
numPassengers = 7667
passenger_arriving = (
(2, 0, 1, 3, 1, 1, 2, 1, 0, 1, 0, 0, 0, 3, 1, 3, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0), (2, 2, 4, 2, 0, 1, 0, 1, 2, 0, 0, 1, 0, 4, 6, 1, 2, 3, 0, 1, 1, 1, 0, 0, 0, 0), (2, 2, 3, 3, 0, 2, 0, 1, 1, 0, 1, 0, 0, 2, 1, 4, 2, 2, 0, 3, 1, 1, 0, 0, 1, 0), (6, 1, 2, 1, 3, 1, 0, 1, 2, 1... | true | true |
f70a4ac2929e2a599d2d671f614c03a61a104b68 | 1,788 | py | Python | tests/parsers/plist_plugins/spotlight_volume.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | 1 | 2020-12-04T10:26:34.000Z | 2020-12-04T10:26:34.000Z | tests/parsers/plist_plugins/spotlight_volume.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | null | null | null | tests/parsers/plist_plugins/spotlight_volume.py | nflexfo/plaso | 5da7aa51c39b593773687fdf20a93ba35fc492b4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Spotlight Volume configuration plist plugin."""
from __future__ import unicode_literals
import unittest
from plaso.parsers.plist_plugins import spotlight_volume
from tests.parsers.plist_plugins import test_lib
class SpotlightVolumePluginTest(test_lib... | 31.928571 | 73 | 0.748881 |
from __future__ import unicode_literals
import unittest
from plaso.parsers.plist_plugins import spotlight_volume
from tests.parsers.plist_plugins import test_lib
class SpotlightVolumePluginTest(test_lib.PlistPluginTestCase):
def testProcess(self):
plist_name = 'VolumeConfiguration.plist'
plugin = spot... | true | true |
f70a4acf2ec4271147663a6bc4e1d881de4e042a | 508 | py | Python | mapbox_tilesets/errors.py | bozdoz/tilesets-cli | 05a00bf7ec9e88bc123ffc3833ff4fd47e6bb1f9 | [
"BSD-2-Clause"
] | null | null | null | mapbox_tilesets/errors.py | bozdoz/tilesets-cli | 05a00bf7ec9e88bc123ffc3833ff4fd47e6bb1f9 | [
"BSD-2-Clause"
] | null | null | null | mapbox_tilesets/errors.py | bozdoz/tilesets-cli | 05a00bf7ec9e88bc123ffc3833ff4fd47e6bb1f9 | [
"BSD-2-Clause"
] | null | null | null | """Error handling for the tilesets CLI"""
class TilesetsError(Exception):
"""Base Tilesets error
Deriving errors from this base isolates module development
problems from Python usage problems.
"""
exit_code = 1
def __init__(self, message):
"""Error constructor
Parameters
... | 20.32 | 62 | 0.610236 |
class TilesetsError(Exception):
exit_code = 1
def __init__(self, message):
self.message = message
class TilesetNameError(TilesetsError):
| true | true |
f70a4b45aadb056434a71d7ec721b0fdf2efa485 | 6,084 | py | Python | webdriver/tests/find_elements_from_shadow_root/find.py | jimmywarting/wpt | 75d80fa43c763935dff59b3c6b21f4dffa9b03b7 | [
"BSD-3-Clause"
] | 3 | 2015-11-18T06:24:23.000Z | 2017-05-21T13:55:56.000Z | webdriver/tests/find_elements_from_shadow_root/find.py | jimmywarting/wpt | 75d80fa43c763935dff59b3c6b21f4dffa9b03b7 | [
"BSD-3-Clause"
] | 153 | 2021-01-28T16:58:19.000Z | 2022-03-30T22:15:57.000Z | webdriver/tests/find_elements_from_shadow_root/find.py | almajlis/wpt | a1d4dd189a5bdca857845b374946b8002c41d199 | [
"BSD-3-Clause"
] | 4 | 2018-11-09T00:04:40.000Z | 2022-01-21T00:22:19.000Z | import pytest
from webdriver.transport import Response
from tests.support.asserts import assert_error, assert_same_element, assert_success
def find_elements(session, shadow_id, using, value):
return session.transport.send(
"POST", "session/{session_id}/shadow/{shadow_id}/elements".format(
se... | 41.958621 | 101 | 0.668146 | import pytest
from webdriver.transport import Response
from tests.support.asserts import assert_error, assert_same_element, assert_success
def find_elements(session, shadow_id, using, value):
return session.transport.send(
"POST", "session/{session_id}/shadow/{shadow_id}/elements".format(
se... | true | true |
f70a4bdbeaf0914b6cd41aaeb149332620257846 | 1,129 | py | Python | localnet/delegate.py | moneyhoardermike/MHG.Network | 7c1ef4b4d17223d91b613b4f96b100248bd45a74 | [
"Apache-2.0"
] | 1 | 2022-03-27T20:20:54.000Z | 2022-03-27T20:20:54.000Z | localnet/delegate.py | moneyhoardermike/MHG.Network | 7c1ef4b4d17223d91b613b4f96b100248bd45a74 | [
"Apache-2.0"
] | null | null | null | localnet/delegate.py | moneyhoardermike/MHG.Network | 7c1ef4b4d17223d91b613b4f96b100248bd45a74 | [
"Apache-2.0"
] | null | null | null | import sys
import subprocess
import yaml
if len(sys.argv) != 4:
print('usage: delegate.py [val1_stake] [val2_stake] [val3_stake]')
exit(0)
# Load config
confFile = open('./conf.yml')
conf = yaml.safe_load(confFile)
def delegate_cmd(valNumber, amount):
cmd = ["spnd", "tx", "staking", "delegate"]
cmd.a... | 22.137255 | 70 | 0.631532 | import sys
import subprocess
import yaml
if len(sys.argv) != 4:
print('usage: delegate.py [val1_stake] [val2_stake] [val3_stake]')
exit(0)
confFile = open('./conf.yml')
conf = yaml.safe_load(confFile)
def delegate_cmd(valNumber, amount):
cmd = ["spnd", "tx", "staking", "delegate"]
cmd.append(conf['va... | true | true |
f70a4cfab56b4aac1796dc8a0daf25899daa7761 | 589 | py | Python | TianJiPlanBackend/core/utils.py | weridolin/tianji-plan | b98a49d92ee2a365095f9e15f4231f5178aca1c0 | [
"Apache-2.0"
] | null | null | null | TianJiPlanBackend/core/utils.py | weridolin/tianji-plan | b98a49d92ee2a365095f9e15f4231f5178aca1c0 | [
"Apache-2.0"
] | null | null | null | TianJiPlanBackend/core/utils.py | weridolin/tianji-plan | b98a49d92ee2a365095f9e15f4231f5178aca1c0 | [
"Apache-2.0"
] | 1 | 2021-12-07T11:45:13.000Z | 2021-12-07T11:45:13.000Z | '''
Description:
email: 359066432@qq.com
Author: lhj
software: vscode
Date: 2021-09-19 17:28:48
platform: windows 10
LastEditors: lhj
LastEditTime: 2021-09-20 20:01:05
'''
from dataclasses import dataclass
@dataclass
class UserBriefInfo(object):
user_id:str
user_name:str
@classmethod
def from_user(c... | 19.633333 | 59 | 0.704584 |
from dataclasses import dataclass
@dataclass
class UserBriefInfo(object):
user_id:str
user_name:str
@classmethod
def from_user(cls,user):
return cls(user_id=user.id,user_name=user.username)
@property
def cache_permission_key(self):
return f"user:{self.user_name}:permissions"
... | true | true |
f70a4d8c027af9c7d598f7510fa3b661626b62ff | 4,113 | py | Python | inkscape_control.py | pkumath/datastructure | 0b440b59af73ed73c575df5cd1c67946aa510dba | [
"MIT"
] | 4 | 2020-05-19T05:38:37.000Z | 2020-05-27T04:14:17.000Z | inkscape_control.py | pkumath/datastructure | 0b440b59af73ed73c575df5cd1c67946aa510dba | [
"MIT"
] | null | null | null | inkscape_control.py | pkumath/datastructure | 0b440b59af73ed73c575df5cd1c67946aa510dba | [
"MIT"
] | 1 | 2020-05-19T05:41:53.000Z | 2020-05-19T05:41:53.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import paste
import subprocess
from multiprocessing import Process
from pathlib import Path
import tkinter.messagebox as messagebox
from shutil import copy
from appdirs import user_config_dir
import logging as log
from globe import Globe as globe
from util impo... | 32.132813 | 155 | 0.653538 |
import os
import paste
import subprocess
from multiprocessing import Process
from pathlib import Path
import tkinter.messagebox as messagebox
from shutil import copy
from appdirs import user_config_dir
import logging as log
from globe import Globe as globe
from util import StrUtil as strutil
import workspace
SYSTEM ... | true | true |
f70a4e0537f64d4f57d9c31c05f6e8dab7dea946 | 26,170 | py | Python | tensorflow/python/data/experimental/ops/batching.py | nicolasoyharcabal/tensorflow | 0d3b58cfe91c6b865a14701345d7a84ce949c0e3 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/experimental/ops/batching.py | nicolasoyharcabal/tensorflow | 0d3b58cfe91c6b865a14701345d7a84ce949c0e3 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/experimental/ops/batching.py | nicolasoyharcabal/tensorflow | 0d3b58cfe91c6b865a14701345d7a84ce949c0e3 | [
"Apache-2.0"
] | null | null | null | # 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 applica... | 39.893293 | 104 | 0.713068 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.data.experimental.ops import get_single_element
from tensorflow.python.data.experimental.ops import grouping
from tensorflow.python.data.ops import dataset_ops
from te... | true | true |
f70a4e811c901d0c029f84d9ed26ad4bb9ede94d | 2,022 | py | Python | src/compas_rv2/ui/Rhino/RV2/dev/RV2force_modify_vertices_cmd.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | 34 | 2020-04-27T13:54:38.000Z | 2022-01-17T19:16:27.000Z | src/compas_rv2/ui/Rhino/RV2/dev/RV2force_modify_vertices_cmd.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | 306 | 2020-04-27T12:00:54.000Z | 2022-03-23T22:28:54.000Z | src/compas_rv2/ui/Rhino/RV2/dev/RV2force_modify_vertices_cmd.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | 11 | 2020-06-30T08:23:40.000Z | 2022-02-01T20:47:39.000Z | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.utilities import flatten
import compas_rhino
from compas_rv2.rhino import get_scene
from compas_rv2.rhino import rv2_undo
from compas_rv2.rhino import rv2_error
# from compas_rv2.rhino import Modif... | 27.69863 | 116 | 0.611276 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.utilities import flatten
import compas_rhino
from compas_rv2.rhino import get_scene
from compas_rv2.rhino import rv2_undo
from compas_rv2.rhino import rv2_error
__commandname__ = "RV2force_modify... | true | true |
f70a4f99ed17d4e51bbbcf86b20403048c13eea3 | 491 | py | Python | tests/system/test_base.py | live-wire/terminalbeat | c85b86d6b118beb52b1e4d037c1984f36a1e5935 | [
"Apache-2.0"
] | 8 | 2019-01-14T14:49:09.000Z | 2020-07-24T18:32:06.000Z | tests/system/test_base.py | live-wire/terminalbeat | c85b86d6b118beb52b1e4d037c1984f36a1e5935 | [
"Apache-2.0"
] | 1 | 2019-11-26T22:32:53.000Z | 2019-11-28T03:11:30.000Z | tests/system/test_base.py | live-wire/terminalbeat | c85b86d6b118beb52b1e4d037c1984f36a1e5935 | [
"Apache-2.0"
] | 1 | 2019-09-01T05:47:58.000Z | 2019-09-01T05:47:58.000Z | from terminalbeat import BaseTest
import os
class Test(BaseTest):
def test_base(self):
"""
Basic test with exiting Terminalbeat normally
"""
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*"
)
terminalbeat_proc = self.star... | 24.55 | 77 | 0.641548 | from terminalbeat import BaseTest
import os
class Test(BaseTest):
def test_base(self):
self.render_config_template(
path=os.path.abspath(self.working_dir) + "/log/*"
)
terminalbeat_proc = self.start_beat()
self.wait_until(lambda: self.log_contains("terminalbeat is ru... | true | true |
f70a517cef671f469725873b87a9a185709dbe5b | 9,021 | py | Python | saleor/credit/models.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | saleor/credit/models.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | saleor/credit/models.py | glosoftgroup/KahawaHardware | 893e94246583addf41c3bb0d58d2ce6bcd233c4f | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from decimal import Decimal
from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import Sum
from django.utils.encoding import python_2_unicode_compatible
from django.utils.tim... | 41.004545 | 121 | 0.687729 | from __future__ import unicode_literals
from decimal import Decimal
from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import Sum
from django.utils.encoding import python_2_unicode_compatible
from django.utils.tim... | true | true |
f70a5222663a3702e2a5dc5e9d2718c5d92ef525 | 629 | py | Python | solve.py | LeoQuote/power-flow-python | 7382c116d3b2583fa3d8406d58290aa3ba91db7c | [
"MIT"
] | 3 | 2015-11-05T08:11:02.000Z | 2021-05-07T13:44:53.000Z | solve.py | LeoQuote/power-flow-python | 7382c116d3b2583fa3d8406d58290aa3ba91db7c | [
"MIT"
] | null | null | null | solve.py | LeoQuote/power-flow-python | 7382c116d3b2583fa3d8406d58290aa3ba91db7c | [
"MIT"
] | null | null | null | for j in range(y_bus_size - 1, -1, -1):
f=[]
f += [0] * j
h=f.copy()
f += [1]
for i in range(j + 1, y_bus_size):
f += [0]
for k in range(j, i):
# print(j,i,k)
# 临时变量temp,存储l f 的乘积
f[i] -= facter_table[k, i] * f[k]
# print(f)
for i in range(... | 27.347826 | 59 | 0.430843 | for j in range(y_bus_size - 1, -1, -1):
f=[]
f += [0] * j
h=f.copy()
f += [1]
for i in range(j + 1, y_bus_size):
f += [0]
for k in range(j, i):
f[i] -= facter_table[k, i] * f[k]
for i in range(j, y_bus_size):
h += [f[i] * facter_tab... | true | true |
f70a52490eb88a7e170aead0a106cbf79e90a6dd | 461 | py | Python | env/Lib/site-packages/plotly/validators/scattergl/marker/colorbar/_tickprefix.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/scattergl/marker/colorbar/_tickprefix.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/scattergl/marker/colorbar/_tickprefix.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class TickprefixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="tickprefix",
parent_name="scattergl.marker.colorbar",
**kwargs
):
super(TickprefixValidator, self).__init__(
plotly_... | 27.117647 | 72 | 0.633406 | import _plotly_utils.basevalidators
class TickprefixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="tickprefix",
parent_name="scattergl.marker.colorbar",
**kwargs
):
super(TickprefixValidator, self).__init__(
plotly_... | true | true |
f70a529f71d485b581dd3d7d9dad29024325cffa | 1,391 | py | Python | tests/features/steps/call_steps.py | candango/taskio | cd9687dc7facfea45f45631f44f21075c14e4a7b | [
"Apache-2.0"
] | null | null | null | tests/features/steps/call_steps.py | candango/taskio | cd9687dc7facfea45f45631f44f21075c14e4a7b | [
"Apache-2.0"
] | 9 | 2020-02-13T03:16:18.000Z | 2022-03-24T05:14:43.000Z | tests/features/steps/call_steps.py | candango/taskio | cd9687dc7facfea45f45631f44f21075c14e4a7b | [
"Apache-2.0"
] | 1 | 2019-10-09T14:52:56.000Z | 2019-10-09T14:52:56.000Z | # -*- coding: UTF-8 -*-
#
# Copyright 2019-2022 Flávio Gonçalves Garcia
#
# 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 b... | 37.594595 | 77 | 0.777858 |
from behave import given, when, then
from taskio.process import TaskioLoader
from behave.api.async_step import async_run_until_complete
from tests import PROJECT_ROOT
import sys
@when("{command} is called from {program} program")
def step_is_called_from_program(context, command, program):
program_attribute = "%s... | true | true |
f70a52a9a23a725b7c77f7cc457a46c90b493435 | 196 | py | Python | sphinx/source/docs/user_guide/source_examples/charts_histogram_values_field_arg.py | quasiben/bokeh | 738343bd18c851dfd1fdc82cf35fe3eb4cdfd475 | [
"BSD-3-Clause"
] | 1 | 2017-08-02T23:12:03.000Z | 2017-08-02T23:12:03.000Z | sphinx/source/docs/user_guide/source_examples/charts_histogram_values_field_arg.py | evidation-health/bokeh | 2c580d93419033b962d36e3c46d7606cc2f24606 | [
"BSD-3-Clause"
] | null | null | null | sphinx/source/docs/user_guide/source_examples/charts_histogram_values_field_arg.py | evidation-health/bokeh | 2c580d93419033b962d36e3c46d7606cc2f24606 | [
"BSD-3-Clause"
] | null | null | null |
from bokeh.charts import Histogram, output_file, show
from bokeh.sampledata.autompg import autompg as df
p = Histogram(df, 'hp', title="HP Distribution")
output_file("histogram.html",)
show(p) | 21.777778 | 53 | 0.765306 |
from bokeh.charts import Histogram, output_file, show
from bokeh.sampledata.autompg import autompg as df
p = Histogram(df, 'hp', title="HP Distribution")
output_file("histogram.html",)
show(p) | true | true |
f70a52f93364ea4968332dac6b553bf9463c313f | 778 | py | Python | src/token.py | AsmusAB/wrap-tz-contracts | 8b93a63507e5f8e5ce816ceb7fe0cbaf5e83f6e7 | [
"MIT"
] | 1 | 2021-12-11T17:14:31.000Z | 2021-12-11T17:14:31.000Z | src/token.py | AsmusAB/wrap-tz-contracts | 8b93a63507e5f8e5ce816ceb7fe0cbaf5e83f6e7 | [
"MIT"
] | 4 | 2021-02-26T08:02:11.000Z | 2021-06-23T20:27:39.000Z | src/token.py | AsmusAB/wrap-tz-contracts | 8b93a63507e5f8e5ce816ceb7fe0cbaf5e83f6e7 | [
"MIT"
] | 6 | 2021-04-13T07:34:52.000Z | 2022-03-09T04:29:47.000Z | from pytezos import PyTezosClient
class Token(object):
def __init__(self, client: PyTezosClient):
self.client = client
def set_admin(self, contract_id, new_admin):
print(f"Setting fa2 admin on {contract_id} to {new_admin}")
call = self.set_admin_call(contract_id, new_admin)
r... | 31.12 | 67 | 0.64653 | from pytezos import PyTezosClient
class Token(object):
def __init__(self, client: PyTezosClient):
self.client = client
def set_admin(self, contract_id, new_admin):
print(f"Setting fa2 admin on {contract_id} to {new_admin}")
call = self.set_admin_call(contract_id, new_admin)
r... | true | true |
f70a53626db7b46409330eca5f315ce54d9032aa | 8,161 | py | Python | Scripts/DvdListFiles.py | ogamespec/dolwin-python | c5dade6a9fc1dd716d85a839a4ce967a65011292 | [
"CC0-1.0"
] | 2 | 2020-10-16T09:49:22.000Z | 2020-11-18T01:11:58.000Z | Scripts/DvdListFiles.py | ogamespec/dolwin-python | c5dade6a9fc1dd716d85a839a4ce967a65011292 | [
"CC0-1.0"
] | null | null | null | Scripts/DvdListFiles.py | ogamespec/dolwin-python | c5dade6a9fc1dd716d85a839a4ce967a65011292 | [
"CC0-1.0"
] | null | null | null | '''
Parse the FST of the current disk and list the files
Example:
MountIso c:/isos/ac.gcm (mount existing GCM)
% DvdListFiles
'''
def do_command(dolwin, args):
# Check if any DVD is mounted (real GCM image or DolphinSDK virtual disk)
mounted = False
res = dolwin.ExecuteWi... | 31.754864 | 173 | 0.620635 | def do_command(dolwin, args):
mounted = False
res = dolwin.ExecuteWithResult ("DvdInfo 1")
for i in res["result"]:
if type(i) == str:
mounted = i != ""
if not mounted:
print ("DVD is not mounted")
return
DVD_BB2_OFFSET = 0x0420
DVD_AP... | true | true |
f70a53838caca2eaa018cef84eeb42f6e4dd002b | 223 | py | Python | exer2/multiply.py | JekyllAndHyde8999/Git-Tutorials-AIDC | 5747e05980c82fd3a22dc3102bcede79079842f9 | [
"MIT"
] | null | null | null | exer2/multiply.py | JekyllAndHyde8999/Git-Tutorials-AIDC | 5747e05980c82fd3a22dc3102bcede79079842f9 | [
"MIT"
] | null | null | null | exer2/multiply.py | JekyllAndHyde8999/Git-Tutorials-AIDC | 5747e05980c82fd3a22dc3102bcede79079842f9 | [
"MIT"
] | null | null | null | # The objective of this program is to multiply two input numbers
def multiply(*args):
a = args
res = 1
for ele in a:
res *= ele
return res
a1=int(input())
a2=int(input())
print(multiply(a1,a2))
| 13.9375 | 64 | 0.61435 |
def multiply(*args):
a = args
res = 1
for ele in a:
res *= ele
return res
a1=int(input())
a2=int(input())
print(multiply(a1,a2))
| true | true |
f70a5395c3923da0f06930099407d0b2dd77e18e | 1,322 | py | Python | h/layouts.py | gnott/h | 77a0452b8196f7efb97d4a400ce7583062d620e6 | [
"MIT"
] | null | null | null | h/layouts.py | gnott/h | 77a0452b8196f7efb97d4a400ce7583062d620e6 | [
"MIT"
] | null | null | null | h/layouts.py | gnott/h | 77a0452b8196f7efb97d4a400ce7583062d620e6 | [
"MIT"
] | null | null | null | from pyramid_layout.layout import layout_config
@layout_config(template='h:templates/base.pt')
class BaseLayout(object):
csp = None
inline_webfont = True
requirements = (('app', None),)
def __init__(self, context, request):
self.context = context
self.request = request
self.fo... | 27.541667 | 68 | 0.666415 | from pyramid_layout.layout import layout_config
@layout_config(template='h:templates/base.pt')
class BaseLayout(object):
csp = None
inline_webfont = True
requirements = (('app', None),)
def __init__(self, context, request):
self.context = context
self.request = request
self.fo... | true | true |
f70a53bcae60ac2df6c5fb334f3698dce45cc9af | 819 | py | Python | test/prophet_model.py | jsonbruce/MTSAnomalyDetection | 94e1b3177f8260804a4f9079ce7358f984521471 | [
"Apache-2.0"
] | 28 | 2017-09-10T01:45:40.000Z | 2021-12-02T11:57:48.000Z | test/prophet_model.py | maxsxu/MTSAnomalyDetection | 94e1b3177f8260804a4f9079ce7358f984521471 | [
"Apache-2.0"
] | 3 | 2019-05-28T08:29:20.000Z | 2019-08-29T20:58:56.000Z | test/prophet_model.py | maxsxu/MTSAnomalyDetection | 94e1b3177f8260804a4f9079ce7358f984521471 | [
"Apache-2.0"
] | 14 | 2017-11-28T10:32:59.000Z | 2021-07-01T12:49:45.000Z | #!/usr/bin/env python
# coding=utf-8
# Created by max on 17-5-4.
import os
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from fbprophet import Prophet
from pandas import Series, DataFrame
DATA_FILE = "dataset/data0.csv"
def main(args):
data = pd.read_csv(DATA_FILE, parse_d... | 20.475 | 74 | 0.680098 |
import os
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from fbprophet import Prophet
from pandas import Series, DataFrame
DATA_FILE = "dataset/data0.csv"
def main(args):
data = pd.read_csv(DATA_FILE, parse_dates=True, index_col='timestamp')
data['ds'] = data.inde... | true | true |
f70a5536b187b95499372854a9278b60efced3b0 | 788 | py | Python | merge-sort/merge_sort/merge_sort.py | doaa-1996/Data-structures-and-algorithms1 | 5b2b4e1ece2f6671770dac80a95b662345106f49 | [
"MIT"
] | 1 | 2021-06-22T12:26:13.000Z | 2021-06-22T12:26:13.000Z | merge-sort/merge_sort/merge_sort.py | doaa-1996/data-structures-and-algorithms | 5b2b4e1ece2f6671770dac80a95b662345106f49 | [
"MIT"
] | null | null | null | merge-sort/merge_sort/merge_sort.py | doaa-1996/data-structures-and-algorithms | 5b2b4e1ece2f6671770dac80a95b662345106f49 | [
"MIT"
] | null | null | null | def mergeSort(arr):
n= len(arr)
if n > 1:
mid = int(n/2)
left = arr[0:mid]
right = arr[mid:n]
mergeSort(left)
mergeSort(right)
Merge(left, right, arr)
def Merge(left, right, arr):
i = 0
j = 0
k = 0
while i < len(left) and j < len(right):
if... | 20.736842 | 43 | 0.413706 | def mergeSort(arr):
n= len(arr)
if n > 1:
mid = int(n/2)
left = arr[0:mid]
right = arr[mid:n]
mergeSort(left)
mergeSort(right)
Merge(left, right, arr)
def Merge(left, right, arr):
i = 0
j = 0
k = 0
while i < len(left) and j < len(right):
if... | true | true |
f70a5558a78b0bae5dd9be819598d90e827a8312 | 624 | py | Python | sphinxpapyrus/docxbuilder/nodes/important.py | amarin/sphinxpapyrus-docxbuilder | 0fd00a0c5467554d0a2b5ad9cd93ab780511f1a3 | [
"MIT"
] | null | null | null | sphinxpapyrus/docxbuilder/nodes/important.py | amarin/sphinxpapyrus-docxbuilder | 0fd00a0c5467554d0a2b5ad9cd93ab780511f1a3 | [
"MIT"
] | null | null | null | sphinxpapyrus/docxbuilder/nodes/important.py | amarin/sphinxpapyrus-docxbuilder | 0fd00a0c5467554d0a2b5ad9cd93ab780511f1a3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Translate docutils node important formatting.
each important start will processed with visit() and finished with depart()
"""
from docutils.nodes import Node
from sphinxpapyrus.docxbuilder.translator import DocxTranslator
node_name = "important"
def visit(visitor: DocxTranslator, node: N... | 27.130435 | 75 | 0.75 |
from docutils.nodes import Node
from sphinxpapyrus.docxbuilder.translator import DocxTranslator
node_name = "important"
def visit(visitor: DocxTranslator, node: Node):
assert isinstance(visitor, DocxTranslator)
assert isinstance(node, Node)
def depart(visitor: DocxTranslator, node: Node):
assert isins... | true | true |
f70a55c9bd6446009caf8957e8cedb97d86a3592 | 3,679 | py | Python | setup.py | speezepearson/pow | 7c86a36134cb90bfcf6e2740c4293d629b6021a1 | [
"MIT"
] | 5 | 2017-10-31T00:17:30.000Z | 2017-11-11T00:53:08.000Z | setup.py | speezepearson/prpg | 7c86a36134cb90bfcf6e2740c4293d629b6021a1 | [
"MIT"
] | null | null | null | setup.py | speezepearson/prpg | 7c86a36134cb90bfcf6e2740c4293d629b6021a1 | [
"MIT"
] | null | null | null | # Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.markdown'), encoding='utf-8')... | 36.425743 | 94 | 0.665398 | from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.markdown'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='prpg',
version='0.4.1',
description='A pseud... | true | true |
f70a56767a954b3cb026e141fd9f582d9f92fc11 | 847 | py | Python | djangoPharma/app/templatetags/app_tags.py | thodoris/djangoPharma | 76089e67bc9940651a876d078879469127f5ac66 | [
"Apache-2.0"
] | null | null | null | djangoPharma/app/templatetags/app_tags.py | thodoris/djangoPharma | 76089e67bc9940651a876d078879469127f5ac66 | [
"Apache-2.0"
] | null | null | null | djangoPharma/app/templatetags/app_tags.py | thodoris/djangoPharma | 76089e67bc9940651a876d078879469127f5ac66 | [
"Apache-2.0"
] | null | null | null | from django import template
from django.contrib.auth.models import Group
register = template.Library()
@register.filter(name='has_group')
def has_group(user, group_name):
try:
group = Group.objects.get(name=group_name)
except:
return False # group doesn't exist, so for sure the user isn't par... | 29.206897 | 89 | 0.706021 | from django import template
from django.contrib.auth.models import Group
register = template.Library()
@register.filter(name='has_group')
def has_group(user, group_name):
try:
group = Group.objects.get(name=group_name)
except:
return False
if user.is_superuser:
return True
... | true | true |
f70a58845e40a18b54f35acaaa0caa0a007ce791 | 265 | py | Python | demo_app/config/desktop.py | ravik0007/erpapp_tasks | bafd1de9bbf6889e639320b15c6e7c52124ba05b | [
"MIT"
] | null | null | null | demo_app/config/desktop.py | ravik0007/erpapp_tasks | bafd1de9bbf6889e639320b15c6e7c52124ba05b | [
"MIT"
] | null | null | null | demo_app/config/desktop.py | ravik0007/erpapp_tasks | bafd1de9bbf6889e639320b15c6e7c52124ba05b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Demo App",
"color": "grey",
"icon": "octicon octicon-file-directory",
"type": "module",
"label": _("Demo App")
}
]
| 17.666667 | 44 | 0.607547 | from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Demo App",
"color": "grey",
"icon": "octicon octicon-file-directory",
"type": "module",
"label": _("Demo App")
}
]
| true | true |
f70a5b9b2e7e749c433cad42920bd0cd17d8c944 | 4,446 | py | Python | src/pretix/plugins/sendmail/forms.py | sker152/pretix | 92754136a653453d00f0b95cdefac533fec5e1ba | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/plugins/sendmail/forms.py | sker152/pretix | 92754136a653453d00f0b95cdefac533fec5e1ba | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/plugins/sendmail/forms.py | sker152/pretix | 92754136a653453d00f0b95cdefac533fec5e1ba | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from django import forms
from django.urls import reverse
from django.utils.translation import pgettext_lazy, ugettext_lazy as _
from i18nfield.forms import I18nFormField, I18nTextarea, I18nTextInput
from pretix.base.email import get_available_placeholders
from pretix.base.forms import PlaceholderValidator
from pretix.... | 39 | 118 | 0.587494 | from django import forms
from django.urls import reverse
from django.utils.translation import pgettext_lazy, ugettext_lazy as _
from i18nfield.forms import I18nFormField, I18nTextarea, I18nTextInput
from pretix.base.email import get_available_placeholders
from pretix.base.forms import PlaceholderValidator
from pretix.... | true | true |
f70a5c3041d88ac442f82714d37a6a78ffa82afd | 14,503 | py | Python | bases_2021_1S/Grupo 03/parserT28/models/instructions/Expression/trigonometric_functions.py | dadu0699/tytus | e1920f6932c840859e3e79eb8756a1d3da88bd77 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | bases_2021_1S/Grupo 03/parserT28/models/instructions/Expression/trigonometric_functions.py | dadu0699/tytus | e1920f6932c840859e3e79eb8756a1d3da88bd77 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | bases_2021_1S/Grupo 03/parserT28/models/instructions/Expression/trigonometric_functions.py | dadu0699/tytus | e1920f6932c840859e3e79eb8756a1d3da88bd77 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | from parserT28.models.instructions.Expression.type_enum import DATA_TYPE
from parserT28.controllers.three_address_code import ThreeAddressCode
from parserT28.controllers.error_controller import ErrorController
from parserT28.models.instructions.Expression.expression import Expression, Identifiers, PrimitiveData
from pa... | 46.187898 | 102 | 0.524581 | from parserT28.models.instructions.Expression.type_enum import DATA_TYPE
from parserT28.controllers.three_address_code import ThreeAddressCode
from parserT28.controllers.error_controller import ErrorController
from parserT28.models.instructions.Expression.expression import Expression, Identifiers, PrimitiveData
from pa... | true | true |
f70a5c8395fa19831b0e3bd7d8affacab5114e5c | 5,465 | py | Python | docs/conf.py | kattni/Adafruit_CircuitPython_MatrixKeypad | cbe0474ca08ce0b9beaf7322ecda487d8db9a5fe | [
"MIT"
] | null | null | null | docs/conf.py | kattni/Adafruit_CircuitPython_MatrixKeypad | cbe0474ca08ce0b9beaf7322ecda487d8db9a5fe | [
"MIT"
] | null | null | null | docs/conf.py | kattni/Adafruit_CircuitPython_MatrixKeypad | cbe0474ca08ce0b9beaf7322ecda487d8db9a5fe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extens... | 33.734568 | 324 | 0.69021 |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
]
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/proje... | true | true |
f70a5d79a04061ba9e020a7854cb72fde0f00f28 | 8,923 | py | Python | DeutschlandStadtLandFluss/generateAnkiDeck.py | SoerenSofke/Anki | 533b3d340f441582d094b04cfa1eb4d99bd7a8d0 | [
"CC0-1.0"
] | null | null | null | DeutschlandStadtLandFluss/generateAnkiDeck.py | SoerenSofke/Anki | 533b3d340f441582d094b04cfa1eb4d99bd7a8d0 | [
"CC0-1.0"
] | null | null | null | DeutschlandStadtLandFluss/generateAnkiDeck.py | SoerenSofke/Anki | 533b3d340f441582d094b04cfa1eb4d99bd7a8d0 | [
"CC0-1.0"
] | null | null | null | import genanki
import glob
from pathlib import Path
import random
def generateAnki():
random.seed(42)
title = 'Deutschland - Stadt, Land, Fluss'
aDeck = genanki.Deck(
2059400110,
title)
# location to name
aModel = genanki.Model(
1607392319,
title,
fields=[... | 26.876506 | 240 | 0.419029 | import genanki
import glob
from pathlib import Path
import random
def generateAnki():
random.seed(42)
title = 'Deutschland - Stadt, Land, Fluss'
aDeck = genanki.Deck(
2059400110,
title)
aModel = genanki.Model(
1607392319,
title,
fields=[
{'name... | true | true |
f70a5d9047d00493189d08971cef9c2e994138ee | 11,060 | py | Python | src/oci/logging/models/create_unified_agent_configuration_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/logging/models/create_unified_agent_configuration_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/logging/models/create_unified_agent_configuration_details.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 36.866667 | 245 | 0.687703 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class CreateUnifiedAgentConfigurationDetails(object):
def __init__(self, **kwargs):
self.swagger_types = {
'dis... | true | true |
f70a5f5db5f4952721a9c7dd0511c372f9948851 | 2,041 | py | Python | whatsapp-bot-venv/Lib/site-packages/twilio/base/serialize.py | RedaMastouri/ConversationalPythonicChatBot | f204276d4b80348d42091b17d1a7d9eea33fb4e0 | [
"MIT"
] | 1,362 | 2015-01-04T10:25:18.000Z | 2022-03-24T10:07:08.000Z | whatsapp-bot-venv/Lib/site-packages/twilio/base/serialize.py | RedaMastouri/ConversationalPythonicChatBot | f204276d4b80348d42091b17d1a7d9eea33fb4e0 | [
"MIT"
] | 299 | 2015-01-30T09:52:39.000Z | 2022-03-31T23:03:02.000Z | bot/lib/python3.7/site-packages/twilio/base/serialize.py | carlosrh18/DavinciBot | d73a6b7f68d7bab25d134d3f85c6b63a86c206c5 | [
"MIT"
] | 622 | 2015-01-03T04:43:09.000Z | 2022-03-29T14:11:00.000Z | import datetime
import json
from twilio.base import values
def iso8601_date(d):
"""
Return a string representation of a date that the Twilio API understands
Format is YYYY-MM-DD. Returns None if d is not a string, datetime, or date
"""
if d == values.unset:
return d
elif isinstance(d,... | 24.590361 | 78 | 0.602646 | import datetime
import json
from twilio.base import values
def iso8601_date(d):
if d == values.unset:
return d
elif isinstance(d, datetime.datetime):
return str(d.date())
elif isinstance(d, datetime.date):
return str(d)
elif isinstance(d, str):
return d
def iso8601_d... | true | true |
f70a6146604ae77580af15ad77d5692ec2f498f1 | 4,713 | py | Python | tests/test_dialects.py | blthree/sqlglot | c3130584db6d767575854ba0d57da37e026863c9 | [
"MIT"
] | null | null | null | tests/test_dialects.py | blthree/sqlglot | c3130584db6d767575854ba0d57da37e026863c9 | [
"MIT"
] | null | null | null | tests/test_dialects.py | blthree/sqlglot | c3130584db6d767575854ba0d57da37e026863c9 | [
"MIT"
] | null | null | null | import unittest
from sqlglot import transpile
from sqlglot.errors import ErrorLevel, UnsupportedError
class TestDialects(unittest.TestCase):
def test_mysql(self):
sql = transpile('SELECT CAST(`a`.`b` AS INT) FROM foo', read='mysql', write='mysql')[0]
self.assertEqual(sql, 'SELECT CAST(`a`.`b` AS I... | 46.663366 | 107 | 0.611288 | import unittest
from sqlglot import transpile
from sqlglot.errors import ErrorLevel, UnsupportedError
class TestDialects(unittest.TestCase):
def test_mysql(self):
sql = transpile('SELECT CAST(`a`.`b` AS INT) FROM foo', read='mysql', write='mysql')[0]
self.assertEqual(sql, 'SELECT CAST(`a`.`b` AS I... | true | true |
f70a6173c8c03d653e854b67508634dd8a582875 | 189 | py | Python | tools/pathutils.py | Laogeodritt/KazTron | 42f35e520875b458ffde7c2729865c95de606aca | [
"MIT"
] | 6 | 2018-07-04T20:41:01.000Z | 2021-09-08T08:10:34.000Z | tools/pathutils.py | Laogeodritt/KazTron | 42f35e520875b458ffde7c2729865c95de606aca | [
"MIT"
] | 259 | 2018-05-01T22:41:32.000Z | 2022-02-08T23:25:00.000Z | tools/pathutils.py | Laogeodritt/KazTron | 42f35e520875b458ffde7c2729865c95de606aca | [
"MIT"
] | 6 | 2019-04-16T22:13:15.000Z | 2021-12-15T08:06:38.000Z | from pathlib import Path
import sys
import os
def add_application_path():
app_path = Path(__file__).resolve().parents[1]
sys.path.append(str(app_path))
os.chdir(str(app_path))
| 21 | 50 | 0.730159 | from pathlib import Path
import sys
import os
def add_application_path():
app_path = Path(__file__).resolve().parents[1]
sys.path.append(str(app_path))
os.chdir(str(app_path))
| true | true |
f70a6277163e65611b36ebc3dd064be9f81de3f7 | 1,159 | py | Python | web/addons/hr_holidays/tests/__init__.py | diogocs1/comps | 63df07f6cf21c41e4527c06e2d0499f23f4322e7 | [
"Apache-2.0"
] | null | null | null | web/addons/hr_holidays/tests/__init__.py | diogocs1/comps | 63df07f6cf21c41e4527c06e2d0499f23f4322e7 | [
"Apache-2.0"
] | null | null | null | web/addons/hr_holidays/tests/__init__.py | diogocs1/comps | 63df07f6cf21c41e4527c06e2d0499f23f4322e7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | 39.965517 | 78 | 0.630716 |
from openerp.addons.hr_holidays.tests import test_holidays_flow
checks = [
test_holidays_flow,
]
| true | true |
f70a627d9cb818695d9704ab57ce2d2dce8ac924 | 248 | py | Python | plex_notifier/__init__.py | sudoursa/plex_notifier | d0c7123d23b7e5a37ef5ad4ca0ab2c324d9c2332 | [
"MIT"
] | 1 | 2018-01-22T21:25:40.000Z | 2018-01-22T21:25:40.000Z | plex_notifier/__init__.py | sudoursa/plex_notifier | d0c7123d23b7e5a37ef5ad4ca0ab2c324d9c2332 | [
"MIT"
] | 16 | 2018-01-22T15:22:26.000Z | 2018-01-27T22:18:12.000Z | plex_notifier/__init__.py | sudoursa/plex_notifier | d0c7123d23b7e5a37ef5ad4ca0ab2c324d9c2332 | [
"MIT"
] | 1 | 2018-01-28T23:49:10.000Z | 2018-01-28T23:49:10.000Z | """
importing public methods
"""
from .plex_auth import connect_to_plex
from .plex_movies import return_movies
from .plex_tv import return_tv
from .plex_users import get_emails
from .plex_users import unsub_emails
from .plex_email import send_mail
| 24.8 | 38 | 0.834677 | from .plex_auth import connect_to_plex
from .plex_movies import return_movies
from .plex_tv import return_tv
from .plex_users import get_emails
from .plex_users import unsub_emails
from .plex_email import send_mail
| true | true |
f70a628c1ce95ca174fbb067a483d898b989003d | 1,265 | py | Python | _unittests/ut_packaged/test_LONG_script_install.py | sdpython/pymyinstall | 72b3a56a29def0694e34ccae910bf288a95cf4a5 | [
"MIT"
] | 8 | 2015-08-24T21:01:49.000Z | 2018-01-04T06:34:51.000Z | _unittests/ut_packaged/test_LONG_script_install.py | sdpython/pymyinstall | 72b3a56a29def0694e34ccae910bf288a95cf4a5 | [
"MIT"
] | 66 | 2015-06-14T22:04:58.000Z | 2021-11-11T13:46:03.000Z | _unittests/ut_packaged/test_LONG_script_install.py | sdpython/pymyinstall | 72b3a56a29def0694e34ccae910bf288a95cf4a5 | [
"MIT"
] | 5 | 2016-09-13T18:14:46.000Z | 2021-08-23T12:03:28.000Z | """
@brief test log(time=2s)
"""
import unittest
import warnings
from pyquickhelper.loghelper import fLOG
class TestLONGScriptInstall(unittest.TestCase):
def test_pypi(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
import... | 30.119048 | 72 | 0.527273 | import unittest
import warnings
from pyquickhelper.loghelper import fLOG
class TestLONGScriptInstall(unittest.TestCase):
def test_pypi(self):
fLOG(
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
import xmlrpc.client as xmlrpc_client
... | true | true |
f70a6377aa4fa71b8438d2f648431ccecf2a659a | 1,216 | py | Python | ambassador/views.py | cforcross/django-vue-admin | 269ba3047b6762c565d9a4c306efc86c3ffd4867 | [
"MIT"
] | null | null | null | ambassador/views.py | cforcross/django-vue-admin | 269ba3047b6762c565d9a4c306efc86c3ffd4867 | [
"MIT"
] | null | null | null | ambassador/views.py | cforcross/django-vue-admin | 269ba3047b6762c565d9a4c306efc86c3ffd4867 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import exceptions
from common.serializers import UserSerializer
from core.models import User,Product,Link,OrderItem,Order
from common.authentication import JWTAuthentication
from... | 39.225806 | 65 | 0.754112 | from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import exceptions
from common.serializers import UserSerializer
from core.models import User,Product,Link,OrderItem,Order
from common.authentication import JWTAuthentication
from... | true | true |
f70a649a6c145f8eae91526b87cd9cfca92cdb65 | 679 | py | Python | pyglet/window/cocoa/systemcursor.py | seeminglee/pyglet64 | 3dd167b5b0d3ad132a157e404586e53c2bb21736 | [
"BSD-3-Clause"
] | 1 | 2016-01-09T03:47:39.000Z | 2016-01-09T03:47:39.000Z | pyglet/window/cocoa/systemcursor.py | seeminglee/pyglet64 | 3dd167b5b0d3ad132a157e404586e53c2bb21736 | [
"BSD-3-Clause"
] | null | null | null | pyglet/window/cocoa/systemcursor.py | seeminglee/pyglet64 | 3dd167b5b0d3ad132a157e404586e53c2bb21736 | [
"BSD-3-Clause"
] | null | null | null | from pyglet.libs.darwin.objc_runtime import *
# This class is a wrapper around NSCursor which prevents us from
# sending too many hide or unhide messages in a row. Apparently
# NSCursor treats them like retain/release messages, which can be
# problematic when we are e.g. switching between window & fullscreen.
class S... | 35.736842 | 69 | 0.693667 | from pyglet.libs.darwin.objc_runtime import *
class SystemCursor:
cursor_is_hidden = False
@classmethod
def hide(cls):
if not cls.cursor_is_hidden:
send_message('NSCursor', 'hide')
cls.cursor_is_hidden = True
@classmethod
def unhide(cls):
if cls.cursor_is_hid... | true | true |
f70a67ae0050e3dd5dbc7ea33789132d8704dd2b | 269 | py | Python | src/pycounts_polluxtroy3758/__init__.py | polluxtroy3758/pycounts | 92bcbdb2609eb543c631293c7cf3babb0472565c | [
"MIT"
] | null | null | null | src/pycounts_polluxtroy3758/__init__.py | polluxtroy3758/pycounts | 92bcbdb2609eb543c631293c7cf3babb0472565c | [
"MIT"
] | null | null | null | src/pycounts_polluxtroy3758/__init__.py | polluxtroy3758/pycounts | 92bcbdb2609eb543c631293c7cf3babb0472565c | [
"MIT"
] | null | null | null | # read version from installed package
from importlib.metadata import version
__version__ = version("pycounts_polluxtroy3758")
from pycounts_polluxtroy3758.plotting import plot_words # noqa: F401
from pycounts_polluxtroy3758.pycounts import count_words # noqa: F401
| 33.625 | 70 | 0.836431 | from importlib.metadata import version
__version__ = version("pycounts_polluxtroy3758")
from pycounts_polluxtroy3758.plotting import plot_words from pycounts_polluxtroy3758.pycounts import count_words | true | true |
f70a68ac62bf6c61cd21de3ffd41d24a77bdf900 | 11,410 | py | Python | examples/adminapi.py | fkaufer/confluent-kafka-python | c4ff376cdbfba41b08806df8e4a68d68f953b593 | [
"Apache-2.0"
] | 1 | 2018-07-23T15:01:15.000Z | 2018-07-23T15:01:15.000Z | examples/adminapi.py | AkuDTA/confluent-kafka-python | e4f7bb6d2feeae33ec1aa69f49bc3277265dba48 | [
"Apache-2.0"
] | 1 | 2018-06-14T19:53:56.000Z | 2018-06-14T19:53:56.000Z | examples/adminapi.py | AkuDTA/confluent-kafka-python | e4f7bb6d2feeae33ec1aa69f49bc3277265dba48 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2018 Confluent Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 36.453674 | 113 | 0.627695 |
from confluent_kafka.admin import AdminClient, NewTopic, NewPartitions, ConfigResource, ConfigEntry
from confluent_kafka import KafkaException
import sys
import threading
import logging
logging.basicConfig()
def example_create_topics(a, topics):
new_topics = [NewTopic(topic, num_partitions=3, replication_fact... | true | true |
f70a6906b34d328a586c5a69de02ca915b6ad0ee | 5,457 | py | Python | fixit/cli/run_rules.py | isidentical/Fixit | e9bd1bcce14922d44086ee31798959b302377338 | [
"Apache-2.0"
] | null | null | null | fixit/cli/run_rules.py | isidentical/Fixit | e9bd1bcce14922d44086ee31798959b302377338 | [
"Apache-2.0"
] | null | null | null | fixit/cli/run_rules.py | isidentical/Fixit | e9bd1bcce14922d44086ee31798959b302377338 | [
"Apache-2.0"
] | 1 | 2020-09-09T09:57:35.000Z | 2020-09-09T09:57:35.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Usage:
#
# $ python -m fixit.cli.run_rules --help
# $ python -m fixit.cli.run_rules
# $ python -m fixit.cli.run_rules --rules AvoidOrI... | 31.912281 | 100 | 0.68206 |
import argparse
import itertools
import shutil
import sys
import time
from dataclasses import dataclass
from pathlib import Path
from typing import TYPE_CHECKING, Iterable, Mapping, Optional, Sequence
from libcst import ParserSyntaxError, parse_module
from libcst.metadata import MetadataWrapper
from fixit.cli impor... | true | true |
f70a695a360de2a4638bc8fac6801bae01f235ff | 19,184 | py | Python | gym/envs/__init__.py | Jekyll1021/gym | 1701741df2e6ae9a762fe647122ee8344f586bc9 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | gym/envs/__init__.py | Jekyll1021/gym | 1701741df2e6ae9a762fe647122ee8344f586bc9 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | gym/envs/__init__.py | Jekyll1021/gym | 1701741df2e6ae9a762fe647122ee8344f586bc9 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | from gym.envs.registration import registry, register, make, spec
# Algorithmic
# ----------------------------------------
register(
id='Copy-v0',
entry_point='gym.envs.algorithmic:CopyEnv',
max_episode_steps=200,
reward_threshold=25.0,
)
register(
id='RepeatCopy-v0',
entry_point='gym.envs.alg... | 26.868347 | 151 | 0.634122 | from gym.envs.registration import registry, register, make, spec
register(
id='Copy-v0',
entry_point='gym.envs.algorithmic:CopyEnv',
max_episode_steps=200,
reward_threshold=25.0,
)
register(
id='RepeatCopy-v0',
entry_point='gym.envs.algorithmic:RepeatCopyEnv',
max_episode_steps=200,
r... | true | true |
f70a6966c8f433d99412dfc5c6bb2b7a62863608 | 347 | py | Python | topicnet/cooking_machine/recipes/__init__.py | DmitriyValetov/TopicNet | b450606ce6cdf2b1f75280112627666f325b1b2c | [
"MIT"
] | null | null | null | topicnet/cooking_machine/recipes/__init__.py | DmitriyValetov/TopicNet | b450606ce6cdf2b1f75280112627666f325b1b2c | [
"MIT"
] | null | null | null | topicnet/cooking_machine/recipes/__init__.py | DmitriyValetov/TopicNet | b450606ce6cdf2b1f75280112627666f325b1b2c | [
"MIT"
] | null | null | null | from .multimodal_exploratory_search_pipeline import MultimodalSearchRecipe
from .artm_baseline_pipeline import BaselineRecipe
from .exploratory_search_pipeline import SearchRecipe
from .artm_baseline_pipeline import ARTM_baseline_template as ARTM_baseline
from .exploratory_search_pipeline import exploratory_search_temp... | 57.833333 | 90 | 0.916427 | from .multimodal_exploratory_search_pipeline import MultimodalSearchRecipe
from .artm_baseline_pipeline import BaselineRecipe
from .exploratory_search_pipeline import SearchRecipe
from .artm_baseline_pipeline import ARTM_baseline_template as ARTM_baseline
from .exploratory_search_pipeline import exploratory_search_temp... | true | true |
f70a69b8a7b993da0e40d67273f8006f8f15f747 | 2,299 | py | Python | grr/parsers/windows_persistence_test.py | StanislavParovoy/GRR | 7cdf490f9be2ccc0a8160c9b8ae23b73922049d5 | [
"Apache-2.0"
] | 5 | 2017-03-17T08:25:09.000Z | 2022-02-22T05:28:14.000Z | grr/parsers/windows_persistence_test.py | StanislavParovoy/GRR | 7cdf490f9be2ccc0a8160c9b8ae23b73922049d5 | [
"Apache-2.0"
] | null | null | null | grr/parsers/windows_persistence_test.py | StanislavParovoy/GRR | 7cdf490f9be2ccc0a8160c9b8ae23b73922049d5 | [
"Apache-2.0"
] | 3 | 2018-12-07T07:04:37.000Z | 2022-02-22T05:28:16.000Z | #!/usr/bin/env python
"""Tests for grr.parsers.windows_persistence."""
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import paths as rdf_paths
from grr.lib.rdfvalues import protodict as rdf_protodict
from gr... | 33.808824 | 77 | 0.683776 |
from grr.lib import flags
from grr.lib import rdfvalue
from grr.lib import test_lib
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import paths as rdf_paths
from grr.lib.rdfvalues import protodict as rdf_protodict
from grr.parsers import windows_persistence
class WindowsPersistenceMechanis... | true | true |
f70a6a6b45048c2b9550d17284e2cbac8687e10a | 1,656 | py | Python | kafka-python-console-sample/consumertask.py | IBM-CSM/event-streams-samples | ce90b1f7f57f3d2afff0596b3f4610392c025ece | [
"Apache-2.0"
] | 39 | 2015-10-13T21:41:25.000Z | 2018-08-14T12:29:48.000Z | kafka-python-console-sample/consumertask.py | IBM-CSM/event-streams-samples | ce90b1f7f57f3d2afff0596b3f4610392c025ece | [
"Apache-2.0"
] | 22 | 2016-05-06T15:30:43.000Z | 2018-09-12T06:59:49.000Z | kafka-python-console-sample/consumertask.py | IBM-CSM/event-streams-samples | ce90b1f7f57f3d2afff0596b3f4610392c025ece | [
"Apache-2.0"
] | 92 | 2015-10-13T21:41:25.000Z | 2018-09-19T09:08:10.000Z | """
Copyright 2015-2018 IBM
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | 32.470588 | 106 | 0.629831 | import asyncio
from confluent_kafka import Consumer
class ConsumerTask(object):
def __init__(self, conf, topic_name):
self.consumer = Consumer(conf)
self.topic_name = topic_name
self.running = True
def stop(self):
self.running = False
@asyncio.coroutine
def run(self):... | true | true |
f70a6a7d524410e5221820b26a7da36dcf0ac821 | 1,296 | py | Python | var/spack/repos/builtin/packages/seqan/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/seqan/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/seqan/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Seqan(CMakePackage):
"""SeqAn is an open source C++ library of efficient algorithms and d... | 38.117647 | 95 | 0.70216 |
from spack import *
class Seqan(CMakePackage):
homepage = "https://www.seqan.de"
url = "https://github.com/seqan/seqan/archive/seqan-v2.4.0.tar.gz"
version('2.4.0', sha256='d7084d17729214003e84818e0280a16f223c8f1c6a30eeef040c27e0c0047bd7')
depends_on('cmake@3.4.0:', type='build')
depends... | true | true |
f70a6a9e38230c1855566a8a044921b83b845f35 | 6,386 | py | Python | tests/lite/test_wrappers.py | FeryET/pytorch-lightning | b1f8b111b5085373599758a4e155a482259cdbf0 | [
"Apache-2.0"
] | null | null | null | tests/lite/test_wrappers.py | FeryET/pytorch-lightning | b1f8b111b5085373599758a4e155a482259cdbf0 | [
"Apache-2.0"
] | 1 | 2022-03-18T21:56:53.000Z | 2022-03-18T21:56:53.000Z | tests/lite/test_wrappers.py | FeryET/pytorch-lightning | b1f8b111b5085373599758a4e155a482259cdbf0 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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 i... | 38.939024 | 114 | 0.727216 | from unittest.mock import ANY, Mock
import pytest
import torch
from torch.utils.data.dataloader import DataLoader
from pytorch_lightning.core.mixins import DeviceDtypeModuleMixin
from pytorch_lightning.lite import LightningLite
from pytorch_lightning.lite.wrappers import _LiteDataLoader, _LiteModule, _LiteOptimizer
f... | true | true |
f70a6b28b67cb2ac17dd95251e5df602c3b4223d | 56,239 | py | Python | .install/.backup/platform/gsutil/third_party/boto/boto/beanstalk/layer1.py | bopopescu/google-cloud-sdk | b34e6a18f1e89673508166acce816111c3421e4b | [
"Apache-2.0"
] | 1 | 2017-11-18T18:23:22.000Z | 2017-11-18T18:23:22.000Z | taskqueue/venv_tq/lib/python2.7/site-packages/boto/beanstalk/layer1.py | matthappens/taskqueue | 548979587326b95bf41851eb135052de782e74fc | [
"MIT"
] | null | null | null | taskqueue/venv_tq/lib/python2.7/site-packages/boto/beanstalk/layer1.py | matthappens/taskqueue | 548979587326b95bf41851eb135052de782e74fc | [
"MIT"
] | 1 | 2020-07-24T20:04:47.000Z | 2020-07-24T20:04:47.000Z | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | 46.787854 | 97 | 0.655577 |
import boto
import boto.jsonresponse
from boto.compat import json
from boto.regioninfo import RegionInfo
from boto.connection import AWSQueryConnection
class Layer1(AWSQueryConnection):
APIVersion = '2010-12-01'
DefaultRegionName = 'us-east-1'
DefaultRegionEndpoint = 'elasticbeanstalk.us-east-1.amazonaw... | true | true |
f70a6be4011c55e74593391945721361e11f0255 | 814 | py | Python | concurrency-overview/io_mp.py | syberflea/materials | 54f44725b40edf00c1b523d7a85b34a85014d7eb | [
"MIT"
] | 3,682 | 2018-05-07T19:45:24.000Z | 2022-03-31T15:19:10.000Z | concurrency-overview/io_mp.py | sribarrow/materials | c17c4a4d6f8487e59eac1df8c88ca92b73d6d2a5 | [
"MIT"
] | 148 | 2018-05-15T21:18:49.000Z | 2022-03-21T11:25:39.000Z | concurrency-overview/io_mp.py | sribarrow/materials | c17c4a4d6f8487e59eac1df8c88ca92b73d6d2a5 | [
"MIT"
] | 5,535 | 2018-05-25T23:36:08.000Z | 2022-03-31T16:55:52.000Z | #!/usr/bin/env python3
import requests
import multiprocessing
import time
session = None
def set_global_session():
global session
if not session:
session = requests.Session()
def download_site(url):
with session.get(url) as response:
name = multiprocessing.current_process().name
... | 23.257143 | 70 | 0.675676 | import requests
import multiprocessing
import time
session = None
def set_global_session():
global session
if not session:
session = requests.Session()
def download_site(url):
with session.get(url) as response:
name = multiprocessing.current_process().name
print(f"{name}:Read {l... | true | true |
f70a6c957ea73f9a7a4e7f4df245a126a32c588e | 22,064 | py | Python | tests/test_filters.py | ticketmaster/cloud-custodian | 0da3866f70f858895af228cc08706d0909a2a324 | [
"Apache-2.0"
] | null | null | null | tests/test_filters.py | ticketmaster/cloud-custodian | 0da3866f70f858895af228cc08706d0909a2a324 | [
"Apache-2.0"
] | 4 | 2017-02-02T17:08:23.000Z | 2017-05-25T19:33:19.000Z | tests/test_filters.py | ticketmaster/cloud-custodian | 0da3866f70f858895af228cc08706d0909a2a324 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 28.654545 | 92 | 0.497145 | from __future__ import absolute_import, division, print_function, unicode_literals
from dateutil import tz
from datetime import datetime, timedelta
import unittest
from c7n import filters as base_filters
from c7n.resources.ec2 import filters
from c7n.utils import annotation
from .common import instance, event_data, ... | true | true |
f70a6d4fa3cb899a39d76c539603b4d81d6a554c | 448 | py | Python | 14.py | CallMeTwitch/LeetCode | 7d59b299fe76eb93ecc3d6936ab4bfedeb323ef7 | [
"MIT"
] | null | null | null | 14.py | CallMeTwitch/LeetCode | 7d59b299fe76eb93ecc3d6936ab4bfedeb323ef7 | [
"MIT"
] | null | null | null | 14.py | CallMeTwitch/LeetCode | 7d59b299fe76eb93ecc3d6936ab4bfedeb323ef7 | [
"MIT"
] | null | null | null | class Solution:
def longestCommonPrefix(self, strs):
min_len = len(min(strs, key = len))
for q in range(len(strs)):
strs[q] = list(strs[q])
lst = []
final = ''
for _ in range(min_len):
lst = [q.pop(0) for q in strs]
if all(q ==... | 26.352941 | 46 | 0.4375 | class Solution:
def longestCommonPrefix(self, strs):
min_len = len(min(strs, key = len))
for q in range(len(strs)):
strs[q] = list(strs[q])
lst = []
final = ''
for _ in range(min_len):
lst = [q.pop(0) for q in strs]
if all(q ==... | true | true |
f70a6de635ea8ebcd428588097104e0bda6abb8a | 664 | py | Python | tests/test_slider.py | Yardanico/pylibui-cffi | 10d90f08b6b1e43bf567ffcd22dbe976cb10e80e | [
"MIT"
] | 6 | 2017-10-16T03:23:05.000Z | 2020-11-10T06:24:04.000Z | tests/test_slider.py | TiberiumN/pylibui-cffi | 10d90f08b6b1e43bf567ffcd22dbe976cb10e80e | [
"MIT"
] | null | null | null | tests/test_slider.py | TiberiumN/pylibui-cffi | 10d90f08b6b1e43bf567ffcd22dbe976cb10e80e | [
"MIT"
] | 1 | 2018-09-07T06:14:27.000Z | 2018-09-07T06:14:27.000Z | """
Pylibui test suite.
"""
from pylibui.controls import Slider
from tests.utils import WindowTestCase
class SliderTest(WindowTestCase):
def setUp(self):
super().setUp()
self.slider = Slider(0, 100)
def test_value_initial_value(self):
"""Tests the sliders's `value` initial value is... | 25.538462 | 75 | 0.653614 |
from pylibui.controls import Slider
from tests.utils import WindowTestCase
class SliderTest(WindowTestCase):
def setUp(self):
super().setUp()
self.slider = Slider(0, 100)
def test_value_initial_value(self):
slider = Slider(10, 110)
self.assertEqual(slider.value, 10)
def ... | true | true |
f70a6e363fb6bb482c5e3c38f34d9a3cc6bb57b1 | 2,239 | py | Python | frappe/core/page/background_jobs/background_jobs.py | juhiwue/frappe | 77f88af74e037dcca0bae3f3ef1e8cae7fb0f699 | [
"MIT"
] | null | null | null | frappe/core/page/background_jobs/background_jobs.py | juhiwue/frappe | 77f88af74e037dcca0bae3f3ef1e8cae7fb0f699 | [
"MIT"
] | 17 | 2021-03-22T18:47:14.000Z | 2022-03-15T12:21:00.000Z | frappe/core/page/background_jobs/background_jobs.py | juhiwue/frappe | 77f88af74e037dcca0bae3f3ef1e8cae7fb0f699 | [
"MIT"
] | null | null | null | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
import json
from typing import TYPE_CHECKING, Dict, List
from rq import Queue, Worker
import frappe
from frappe import _
from frappe.utils import convert_utc_to_user_timezone, format_datetime
from frappe.utils.backgro... | 24.336957 | 78 | 0.711925 |
import json
from typing import TYPE_CHECKING, Dict, List
from rq import Queue, Worker
import frappe
from frappe import _
from frappe.utils import convert_utc_to_user_timezone, format_datetime
from frappe.utils.background_jobs import get_redis_conn
from frappe.utils.scheduler import is_scheduler_inactive
if TYPE_CHE... | true | true |
f70a6ea2f3bc1234f058f1d39e3b1937ed425d61 | 10,360 | py | Python | jax/_src/device_array.py | zjzh/jax | 8372b98c4856b6b2363b7bb28abdb4579440a656 | [
"Apache-2.0"
] | null | null | null | jax/_src/device_array.py | zjzh/jax | 8372b98c4856b6b2363b7bb28abdb4579440a656 | [
"Apache-2.0"
] | 8 | 2022-01-03T10:15:55.000Z | 2022-02-14T10:19:45.000Z | jax/_src/device_array.py | zjzh/jax | 8372b98c4856b6b2363b7bb28abdb4579440a656 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.888889 | 108 | 0.721911 |
from functools import partial, partialmethod
import operator
from typing import (Any, List, Optional, Union)
import weakref
import numpy as np
from jax import core
from jax._src.config import config
from jax._src import abstract_arrays
from jax._src import dtypes
from jax._src import profiler
from jax._src.lib impo... | true | true |
f70a6f4e41b9deabaa98231dc49f102c2da5262c | 3,144 | py | Python | pkgs/ipykernel-4.3.1-py27_0/lib/python2.7/site-packages/ipykernel/gui/gtk3embed.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | pkgs/ipykernel-4.3.1-py27_0/lib/python2.7/site-packages/ipykernel/gui/gtk3embed.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 8 | 2015-09-07T03:38:19.000Z | 2021-05-23T03:18:51.000Z | pkgs/ipykernel-4.3.1-py27_0/lib/python2.7/site-packages/ipykernel/gui/gtk3embed.py | wangyum/anaconda | 6e5a0dbead3327661d73a61e85414cf92aa52be6 | [
"Apache-2.0",
"BSD-3-Clause"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | """GUI support for the IPython ZeroMQ kernel - GTK toolkit support.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distribute... | 36.55814 | 79 | 0.54612 |
import sys
from gi.repository import GObject, Gtk
class GTKEmbed(object):
def __init__(self, kernel):
self.kernel = kernel
self.gtk_main = None
self.gtk_main_quit = None
def start(self):
GObject.idle_add(self._wire_kernel)
Gtk.main()
def _wire_ke... | true | true |
f70a703ecf8b20f0a4ea6cf7f1cfc565cffc8462 | 19,936 | py | Python | caesd-master/main.py | korecodes/FYP | b4f67d968081f9199d1555a1729856d4af4a895e | [
"MIT"
] | 1 | 2022-01-18T15:33:46.000Z | 2022-01-18T15:33:46.000Z | caesd-master/main.py | korecodes/FYP | b4f67d968081f9199d1555a1729856d4af4a895e | [
"MIT"
] | null | null | null | caesd-master/main.py | korecodes/FYP | b4f67d968081f9199d1555a1729856d4af4a895e | [
"MIT"
] | null | null | null | #GUI classes for the application
from kivy.app import App
from kivy.lang import Builder
from kivy.core.window import Window
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivy.uix.popup import Popup
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.... | 48.154589 | 169 | 0.589938 | from kivy.app import App
from kivy.lang import Builder
from kivy.core.window import Window
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivy.uix.popup import Popup
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.spinner import Spinner
from kivy.... | true | true |
f70a71c00a69752a6818debf925e56044120def3 | 619 | py | Python | apps/addpaths.py | lorenzcsunikl/Dataset-of-Artefact-Aware-Human-Motion-Capture-using-Inertial-Sensors-Integrated-into-Loose-Clothing | e5864e20d60bd7fa38bf6935ba1bacfadcdb3035 | [
"Apache-2.0"
] | null | null | null | apps/addpaths.py | lorenzcsunikl/Dataset-of-Artefact-Aware-Human-Motion-Capture-using-Inertial-Sensors-Integrated-into-Loose-Clothing | e5864e20d60bd7fa38bf6935ba1bacfadcdb3035 | [
"Apache-2.0"
] | null | null | null | apps/addpaths.py | lorenzcsunikl/Dataset-of-Artefact-Aware-Human-Motion-Capture-using-Inertial-Sensors-Integrated-into-Loose-Clothing | e5864e20d60bd7fa38bf6935ba1bacfadcdb3035 | [
"Apache-2.0"
] | null | null | null | import os, sys, inspect
# realpath() will make your script run, even if you symlink it :)
cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]))
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
# # Use this if you want to include modules from a subfo... | 41.266667 | 105 | 0.722132 | import os, sys, inspect
cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]))
if cmd_folder not in sys.path:
sys.path.insert(0, cmd_folder)
cmd_subfolder = os.path.realpath(
os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[... | true | true |
f70a71c87434c0461dadcc68734d1ada03bc32f7 | 35,695 | py | Python | snaps/openstack/tests/create_image_tests.py | hashnfv/hashnfv-snaps | 0dfca494ef7c2778babfac48d9b701953860b54f | [
"Apache-2.0"
] | null | null | null | snaps/openstack/tests/create_image_tests.py | hashnfv/hashnfv-snaps | 0dfca494ef7c2778babfac48d9b701953860b54f | [
"Apache-2.0"
] | null | null | null | snaps/openstack/tests/create_image_tests.py | hashnfv/hashnfv-snaps | 0dfca494ef7c2778babfac48d9b701953860b54f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs")
# and others. 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://w... | 43.109903 | 79 | 0.620143 | from glanceclient.exc import HTTPBadRequest
try:
from urllib.request import URLError
except ImportError:
from urllib2 import URLError
import logging
import shutil
import unittest
import uuid
import os
from snaps import file_utils
from snaps.openstack import create_image
from snaps.openstack.create_image imp... | true | true |
f70a721597372b0efa52b1d23b20e2d0f1387886 | 7,859 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/10-19_7.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/10-19_7.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_nonlinear_software/10-19_7.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 34.169565 | 81 | 0.529457 | from typing import FrozenSet, Tuple
import pysmt.typing as types
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | true | true |
f70a73527a65c5e526a4eb9382c4dd98ceed86bc | 294 | py | Python | manage.py | dstl/lighthouse | b810742d9f4cbfac02bf99096542499d25c88b58 | [
"MIT"
] | 5 | 2016-05-12T13:47:38.000Z | 2020-06-22T07:33:35.000Z | manage.py | dstl/lighthouse | b810742d9f4cbfac02bf99096542499d25c88b58 | [
"MIT"
] | 7 | 2016-10-24T12:41:09.000Z | 2016-12-08T21:58:18.000Z | manage.py | dstl/lighthouse | b810742d9f4cbfac02bf99096542499d25c88b58 | [
"MIT"
] | 4 | 2016-05-12T21:53:21.000Z | 2021-04-10T22:02:26.000Z | #!/usr/bin/env python
# (c) Crown Owned Copyright, 2016. Dstl.
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lighthouse.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 24.5 | 74 | 0.761905 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lighthouse.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| true | true |
f70a73e7ec769ceacef155b98ab3be8009c63172 | 5,229 | py | Python | models/project.py | jlgoh/labeldat | 057248a22c7f022110d712dbcb61befd40e62760 | [
"MIT"
] | 1 | 2021-09-07T06:34:54.000Z | 2021-09-07T06:34:54.000Z | models/project.py | wilsonteng97/labeldat | bdca5df0af55bdd460807808861de25d762b28da | [
"MIT"
] | 5 | 2021-09-08T02:44:59.000Z | 2022-02-27T10:55:29.000Z | models/project.py | wilsonteng97/labeldat | bdca5df0af55bdd460807808861de25d762b28da | [
"MIT"
] | 1 | 2020-12-31T11:03:39.000Z | 2020-12-31T11:03:39.000Z | from extensions import db
from models.item_data_type import ItemDataType
from models.label import Label
from models.task import Task
class Project(db.Model):
id = db.Column(db.String(80), primary_key=True, nullable=False)
# 1(Project)-to-1(organisation)
org_id = db.Column(db.String(80), db.ForeignKey('org... | 42.169355 | 99 | 0.634921 | from extensions import db
from models.item_data_type import ItemDataType
from models.label import Label
from models.task import Task
class Project(db.Model):
id = db.Column(db.String(80), primary_key=True, nullable=False)
org_id = db.Column(db.String(80), db.ForeignKey('organisation.id'), nullable=False)
... | true | true |
f70a74917258038a2fbc62fab3d8f0fe001b74ce | 8,773 | py | Python | videoanalyst/model/task_model/taskmodel_impl/siamese_track.py | 983632847/video_analyst | 01b7ad278b828a3f7ff7a0488c5ca8f055240192 | [
"MIT"
] | 2 | 2020-07-30T08:26:08.000Z | 2020-11-24T07:40:46.000Z | videoanalyst/model/task_model/taskmodel_impl/siamese_track.py | 983632847/video_analyst | 01b7ad278b828a3f7ff7a0488c5ca8f055240192 | [
"MIT"
] | null | null | null | videoanalyst/model/task_model/taskmodel_impl/siamese_track.py | 983632847/video_analyst | 01b7ad278b828a3f7ff7a0488c5ca8f055240192 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*
import numpy as np
from loguru import logger
import torch
import torch.nn as nn
import torch.nn.functional as F
from videoanalyst.model.common_opr.common_block import (conv_bn_relu,
xcorr_depthwise)
from videoanalyst.model.module_base imp... | 36.861345 | 105 | 0.53904 |
import numpy as np
from loguru import logger
import torch
import torch.nn as nn
import torch.nn.functional as F
from videoanalyst.model.common_opr.common_block import (conv_bn_relu,
xcorr_depthwise)
from videoanalyst.model.module_base import ModuleBase
from vid... | true | true |
f70a75256c638f4a3ce9cda3b9577176e49f3cca | 4,042 | py | Python | youtube_dl/extractor/redtube.py | aalvarito68/https-github.com-rg3-youtube-dl | dfc80bdd2e4ef3d30f161a93f99f3050537944ab | [
"Unlicense"
] | 3 | 2017-09-28T22:31:51.000Z | 2021-09-15T07:43:07.000Z | youtube_dl/extractor/redtube.py | aalvarito68/https-github.com-rg3-youtube-dl | dfc80bdd2e4ef3d30f161a93f99f3050537944ab | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/redtube.py | aalvarito68/https-github.com-rg3-youtube-dl | dfc80bdd2e4ef3d30f161a93f99f3050537944ab | [
"Unlicense"
] | 3 | 2020-12-01T10:58:29.000Z | 2021-07-22T15:57:22.000Z | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
str_to_int,
unified_strdate,
)
class RedTubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www\.)?redtube\.com/|embed\.redtube\... | 35.769912 | 101 | 0.517566 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
str_to_int,
unified_strdate,
)
class RedTubeIE(InfoExtractor):
_VALID_URL = r'https?://(?:(?:www\.)?redtube\.com/|embed\.redtube\... | true | true |
f70a75b50f6ab4c03d21568a0b919684fa9dd706 | 187 | py | Python | repos/tf_ctpn_cpu/lib/utils/setup.py | ysglh/DeepVideoAnalytics | ce807cc1595c813250bb4bc7dfc6fb76cd644335 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2019-03-05T00:46:56.000Z | 2021-11-26T10:20:40.000Z | repos/tf_ctpn_cpu/lib/utils/setup.py | jiangxu87/DeepVideoAnalytics | e401b3273782409b2604657514bec293d6aa75b0 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | repos/tf_ctpn_cpu/lib/utils/setup.py | jiangxu87/DeepVideoAnalytics | e401b3273782409b2604657514bec293d6aa75b0 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 4 | 2021-09-22T07:47:27.000Z | 2022-01-23T14:16:08.000Z | from Cython.Build import cythonize
import numpy as np
from distutils.core import setup
setup(ext_modules=cythonize(["bbox.pyx","cython_nms.pyx"],include_path=[np.get_include()]
))
| 20.777778 | 89 | 0.764706 | from Cython.Build import cythonize
import numpy as np
from distutils.core import setup
setup(ext_modules=cythonize(["bbox.pyx","cython_nms.pyx"],include_path=[np.get_include()]
))
| true | true |
f70a75c0e2859d8527b98b051b3342213f23e151 | 6,992 | py | Python | nicos/clients/gui/panels/base.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-03-26T10:30:45.000Z | 2021-03-26T10:30:45.000Z | nicos/clients/gui/panels/base.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos/clients/gui/panels/base.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 3 | 2020-08-04T18:35:05.000Z | 2021-04-16T11:22:08.000Z | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 36.227979 | 81 | 0.641447 |
from time import time as currenttime
from nicos.clients.gui.config import panel
from nicos.clients.gui.utils import DlgUtils, SettingGroup
from nicos.guisupport.qt import QDialog, QHBoxLayout, QObject, QPainter, \
QPalette, QStyle, QStyleOption, QWidget, pyqtSignal
from nicos.utils import checkSetupSpec
from nic... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.