hexsha stringlengths 40 40 | size int64 6 782k | ext stringclasses 7
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 237 | max_stars_repo_name stringlengths 6 72 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses list | max_stars_count int64 1 53k ⌀ | 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 184 | max_issues_repo_name stringlengths 6 72 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses list | max_issues_count int64 1 27.1k ⌀ | 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 184 | max_forks_repo_name stringlengths 6 72 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses list | max_forks_count int64 1 12.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 782k | avg_line_length float64 2.75 664k | max_line_length int64 5 782k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7070703ba8dec599478c4f2650b2dd7d442b147e | 2,207 | py | Python | tarefas-poo/lista-01/calculos/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-01/calculos/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | tarefas-poo/lista-01/calculos/view/interface_com_usuario.py | victoriaduarte/POO_UFSC | 0c65b4f26383d1e3038d8469bd91fd2c0cb98c1a | [
"MIT"
] | null | null | null | # --------------------------
# UFSC - CTC - INE - INE5603
# Exercício calculos
# --------------------------
# Classe responsável pela interação com o usuário
from view.menu import Menu
from view.paineis.painel_media3 import PainelMedia3
from view.paineis.painel_soma3 import PainelSoma3
from view.paineis.painel_par imp... | 40.127273 | 66 | 0.647032 |
566eeee7a854acb929004936f6bda3b83c8194bb | 1,608 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch07_recursion_advanced/ex08_palinedrome_parts_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch07_recursion_advanced/ex08_palinedrome_parts_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/tests/ch07_recursion_advanced/ex08_palinedrome_parts_test.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | # Beispielprogramm für das Buch "Python Challenge"
#
# Copyright 2020 by Michael Inden
import pytest
from ch07_recursion_advanced.solutions.ex08_all_palidrome_substrings import all_palindrome_parts_rec, \
all_palindrome_parts_rec_optimized, all_palindrome_parts_rec_optimized_v3, longest_palindrome_part
def inpu... | 30.923077 | 103 | 0.663557 |
8e7ae4f53ea25ddd44c7c467ef226ca93412c7f2 | 180 | py | Python | ialgotest/rq_mode/mongo_feed_mod/__init__.py | fs714/ialgotest | eae968cff963549af40ed34745b44c1b5e20efa7 | [
"Apache-2.0"
] | null | null | null | ialgotest/rq_mode/mongo_feed_mod/__init__.py | fs714/ialgotest | eae968cff963549af40ed34745b44c1b5e20efa7 | [
"Apache-2.0"
] | null | null | null | ialgotest/rq_mode/mongo_feed_mod/__init__.py | fs714/ialgotest | eae968cff963549af40ed34745b44c1b5e20efa7 | [
"Apache-2.0"
] | 1 | 2021-11-24T18:59:12.000Z | 2021-11-24T18:59:12.000Z | __config__ = {
'mongo_ip': '127.0.0.1',
'mongo_port': 27017,
'mongo_db_name': 'emquant'
}
def load_mod():
from .mod import MongoFeedMod
return MongoFeedMod()
| 16.363636 | 33 | 0.627778 |
79a07dfd81c10d3fb75ee403f9c5d46736a2a84b | 1,630 | py | Python | compare.py | lokamdheeraj/gemV | f4e615c45e86c3c3db5b5fc9fe3066598e0ad54e | [
"BSD-3-Clause"
] | null | null | null | compare.py | lokamdheeraj/gemV | f4e615c45e86c3c3db5b5fc9fe3066598e0ad54e | [
"BSD-3-Clause"
] | null | null | null | compare.py | lokamdheeraj/gemV | f4e615c45e86c3c3db5b5fc9fe3066598e0ad54e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import subprocess
import os
import time
home = os.environ["HOME"]
# files / first_line; edit if necessaary
golden_run = "/home/lokam/Desktop/GEM5/gem5/out.txt"
first_line = "**** REAL SIMULATION ****"
# don't change anything below
typescript_outputfile = home+"/"+"scriptlog.txt"
# commands
st... | 28.596491 | 90 | 0.644785 |
8de0060411793913614d60b6a9323feac0585882 | 1,289 | py | Python | src/ztc/myos.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/myos.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | src/ztc/myos.py | magistersart/ZTC_fork | ce72734ea575d9846b5b81f3efbfd14fa1f7e532 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/env python
""" ZTC os helper functions
Copyright (c) 2011 Wrike, Inc. [http://www.wrike.com]
"""
import os
import sys
if sys.version_info >= (2, 6):
import subprocess
else:
import popen2
def popen(cmd, logger, inp=None):
""" popen wrapper
returns: ((int)code, (str)stdout) """
os.puten... | 26.306122 | 59 | 0.51668 |
5c1f649383f7762bd8904241aeffd8e96eaaa29b | 2,059 | py | Python | pythonBot/wagenreihung.py | tabacha/WoIstDerWagen | feddaedbde494e9e0983f6a2c34b6b5c65a6ed23 | [
"Apache-2.0"
] | 5 | 2016-06-27T07:37:16.000Z | 2018-04-18T12:09:39.000Z | pythonBot/wagenreihung.py | tabacha/WoIstDerWagen | feddaedbde494e9e0983f6a2c34b6b5c65a6ed23 | [
"Apache-2.0"
] | 21 | 2016-06-26T09:46:25.000Z | 2020-02-23T11:08:35.000Z | pythonBot/wagenreihung.py | tabacha/WoIstDerWagen | feddaedbde494e9e0983f6a2c34b6b5c65a6ed23 | [
"Apache-2.0"
] | null | null | null | import live_api
import re
import logging
log = logging.getLogger(__name__)
def abfahrt(minu):
if (minu<0):
return 'SEIT '+str(((-1)*minu))+' MIN. WEG'
#else:
if (minu>0):
return 'fährt in '+str(minu)+' Min. ab'
return 'fährt jetzt ab'
def liveApiOut(rtn):
if type(rtn)==str:... | 31.19697 | 137 | 0.594463 |
694494707f7790787f57fce69df817b70dca364e | 582 | py | Python | server/server.py | wesolutki/gt | 1f17e8b794aaa15389a915f375e2bb52740d8fc0 | [
"Unlicense"
] | null | null | null | server/server.py | wesolutki/gt | 1f17e8b794aaa15389a915f375e2bb52740d8fc0 | [
"Unlicense"
] | null | null | null | server/server.py | wesolutki/gt | 1f17e8b794aaa15389a915f375e2bb52740d8fc0 | [
"Unlicense"
] | null | null | null | from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
import os
def path_to_dict(path):
d = {'name': os.path.basename(path)}
if os.path.isdir(path):
d['type'] = "directory"
d['children'] = [path_to_dict(os.path.join(path,x)) for x in os.listdir(pa... | 24.25 | 105 | 0.623711 |
c63ffc23829eb43390bd395bc9e847c722b515d6 | 8,431 | py | Python | code/ts_gen.py | AndreBruecke/WebAnalyticsOutlierDetection | f77e4ed605d2f954717ba0e1dffbf2046a30ba1e | [
"MIT"
] | null | null | null | code/ts_gen.py | AndreBruecke/WebAnalyticsOutlierDetection | f77e4ed605d2f954717ba0e1dffbf2046a30ba1e | [
"MIT"
] | null | null | null | code/ts_gen.py | AndreBruecke/WebAnalyticsOutlierDetection | f77e4ed605d2f954717ba0e1dffbf2046a30ba1e | [
"MIT"
] | null | null | null | # Simplistic generation of web analytics data by simulating existing time series using Markov chains.
# Different kinds of outliers can be inserted into the generated datasets.
# -----------------------------------------------------------------------------------------------------
import pandas as pd
import numpy as np... | 42.366834 | 134 | 0.62033 |
d69e3408449165948eb6b9bc5ac1d9e48f01ea1b | 7,586 | py | Python | tests/google/code_jam/2018/r3/name_preserving_network.py | Loks-/competitions | 3bb231ba9dd62447048832f45b09141454a51926 | [
"MIT"
] | 4 | 2018-06-05T14:15:52.000Z | 2022-02-08T05:14:23.000Z | tests/google/code_jam/2018/r3/name_preserving_network.py | Loks-/competitions | 3bb231ba9dd62447048832f45b09141454a51926 | [
"MIT"
] | null | null | null | tests/google/code_jam/2018/r3/name_preserving_network.py | Loks-/competitions | 3bb231ba9dd62447048832f45b09141454a51926 | [
"MIT"
] | 1 | 2018-10-21T11:01:35.000Z | 2018-10-21T11:01:35.000Z | """ Python script for local testing (compatible with both Python 2 and Python 3)
Disclaimer: this is a way to test your solutions, but it is NOT the real judging
system. The judging system behavior might be different.
"""
from __future__ import print_function
import random
import subprocess
import sys
USAGE_MSG = ""... | 30.465863 | 80 | 0.663591 |
ba365dce2f3f98ead0a0afc32677afccf180b946 | 2,002 | py | Python | Common/main.py | Puzzlebox-IMT/Puzzlebox | 6b80e22a4aee3228140692bd6352de18b2f6a96d | [
"MIT"
] | null | null | null | Common/main.py | Puzzlebox-IMT/Puzzlebox | 6b80e22a4aee3228140692bd6352de18b2f6a96d | [
"MIT"
] | null | null | null | Common/main.py | Puzzlebox-IMT/Puzzlebox | 6b80e22a4aee3228140692bd6352de18b2f6a96d | [
"MIT"
] | null | null | null | import multiprocessing as mp
import time
import paho.mqtt.client as mqtt
import sys
from initialization import *
sys.path.append('../WifiEnigma')
sys.path.append('../LifiEnigma')
sys.path.append('../WifiEnigma/WifiUnhacking')
sys.path.append('../WifiEnigma/ZeldaAutomation')
sys.path.append('../WifiEnigma/BattleAI')
... | 23.833333 | 102 | 0.704296 |
24199719883bbf78a781abdf75cc4dd1a8b5ba90 | 5,280 | py | Python | redpwn/2021/web/pastebin-3/app/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | redpwn/2021/web/pastebin-3/app/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | redpwn/2021/web/pastebin-3/app/app.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import os
import secrets
import sqlite3
from flask import (
Flask,
flash,
redirect,
render_template,
request,
session
)
app = Flask(__name__)
app.secret_key = os.getenv('FLASK_KEY')
def execute(query, params=()):
con = sqlite3.connect('../db/db.sqlite3')
cur = con.cursor()
cur.exe... | 22.660944 | 74 | 0.565341 |
79fb73d22632e0c9d776b3289bbb3186b1ed9000 | 41,436 | py | Python | kiosk/views.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | kiosk/views.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | 14 | 2018-09-12T06:59:55.000Z | 2020-02-26T07:17:48.000Z | kiosk/views.py | AndiBr/ffksk | ff4bc4ad26d4571eaa1a6ff815b2e6a876f8ba99 | [
"MIT"
] | null | null | null | from django.shortcuts import redirect, render, render_to_response, HttpResponseRedirect, reverse
from django.db.models import Count
from django.db import connection
from .models import Kontostand, Kiosk, Einkaufsliste, ZumEinkaufVorgemerkt, Gekauft, Kontakt_Nachricht, Start_News
from .models import GeldTransaktionen, P... | 32.833597 | 472 | 0.749011 |
3039955fe70691c7c3eaf76ea755a6ddd77fd07f | 430 | py | Python | Problems/Depth-First Search/medium/AllPathsSourcetoTarget/all_paths_from_source_to_target.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | 1 | 2021-08-16T14:52:05.000Z | 2021-08-16T14:52:05.000Z | Problems/Depth-First Search/medium/AllPathsSourcetoTarget/all_paths_from_source_to_target.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | Problems/Depth-First Search/medium/AllPathsSourcetoTarget/all_paths_from_source_to_target.py | dolong2110/Algorithm-By-Problems-Python | 31ecc7367aaabdd2b0ac0af7f63ca5796d70c730 | [
"MIT"
] | null | null | null | from typing import List
def allPathsSourceTarget(self, graph: List[List[int]]) -> List[List[int]]:
paths, self.n = [], len(graph) - 1
def find_path(idx: int, cur_path: List[int]):
if not graph:
return
if idx == self.n:
paths.append(cur_path)
return
... | 21.5 | 74 | 0.553488 |
0697732f71f414ae707611c7e1518159104e9ae5 | 1,208 | py | Python | python/en/archive/weather_python_code/apis.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/weather_python_code/apis.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/archive/weather_python_code/apis.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 28 00:35:39 2020
@author: aimldl
"""
def get_weather_info( file_name='weather.html', save=True ):
import urllib.request
import urllib.parse
area_code_dict = { "전국": 108,
"서울": 109,
"경기도": 109,
... | 28.093023 | 72 | 0.446192 |
23396c9f4eb662b1aad7ce842a1d57bfaa0a8fbe | 368 | py | Python | benwaonline/schemas/preview_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | benwaonline/schemas/preview_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | 16 | 2017-09-13T10:21:40.000Z | 2020-06-01T04:32:22.000Z | benwaonline/schemas/preview_schema.py | goosechooser/benwaonline | e2879412aa6c3c230d25cd60072445165517b6b6 | [
"MIT"
] | null | null | null | from marshmallow_jsonapi import fields
from benwaonline.schemas import BaseSchema
class PreviewSchema(BaseSchema):
id = fields.String()
filepath = fields.Str()
created_on = fields.DateTime()
class Meta:
type_ = 'previews'
self_url = '/api/previews/{id}'
self_url_kwargs = {'id':... | 28.307692 | 42 | 0.657609 |
2349e3d119082895cc02993d3fd4b4d795ece0a7 | 10,498 | py | Python | tests/test_tokens.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | 6 | 2018-03-29T02:07:44.000Z | 2018-09-26T00:17:31.000Z | tests/test_tokens.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | 82 | 2018-04-01T08:53:59.000Z | 2018-09-28T23:45:05.000Z | tests/test_tokens.py | fluffy-critter/Publ | 868c5a17c605707dde4d1a95d79405301bd12f05 | [
"MIT"
] | null | null | null | """ Bearer token tests """
# pylint:disable=missing-docstring,too-many-statements
import json
import logging
import flask
import pytest
import werkzeug.exceptions as http_error
from publ import tokens, user
from . import PublMock
LOGGER = logging.getLogger(__name__)
def test_token_flow(mocker):
app = flask.F... | 37.359431 | 88 | 0.595637 |
88e713ff9cd66129505f647909262ba56c1617a7 | 530 | py | Python | selfservice/models.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | selfservice/models.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | 5 | 2020-10-10T00:21:37.000Z | 2021-09-22T18:01:46.000Z | selfservice/models.py | KSIUJ/erc-backend | a78a6ee85c2865c8d25c15f40dc72fe32ba4bfd3 | [
"MIT"
] | null | null | null | import secrets
from django.db import models
from registry.models import Member
def _random_token():
return secrets.token_urlsafe(32)
class SelfServiceTokenType(models.TextChoices):
CARD_ID = "CARD_ID", "Card ID"
class SelfServiceToken(models.Model):
member = models.ForeignKey(Member, on_delete=model... | 26.5 | 118 | 0.784906 |
0046ffaf87b99f0a96ea463c94fa33aca5fd8d48 | 1,780 | py | Python | pyScript_NodeManager/InputWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript_NodeManager/InputWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | pyScript_NodeManager/InputWidget.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from PySide2.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QGridLayout, QLineEdit, QPushButton, QMessageBox, QRadioButton, QSizePolicy
from PySide2.QtCore import Qt
class InputWidget(QWidget):
def __init__(self, content_widget):
super(InputWidget, self).__init__()
self.content_widget = cont... | 36.326531 | 140 | 0.674157 |
ee44cd2082dfc01133927dc3918c351e63204a5b | 1,737 | py | Python | selfiescrape.py | rupakc/-Selfie | 756f01e8c3c757e2d234b6f818f1f02194c4f20c | [
"Apache-2.0"
] | null | null | null | selfiescrape.py | rupakc/-Selfie | 756f01e8c3c757e2d234b6f818f1f02194c4f20c | [
"Apache-2.0"
] | null | null | null | selfiescrape.py | rupakc/-Selfie | 756f01e8c3c757e2d234b6f818f1f02194c4f20c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Jan 02 20:29:44 2016
TODO - Add a better Timer or scheduler
@author: Rupak Chakraborty
"""
from bs4 import BeautifulSoup
import urllib
import os
import time
from threading import Timer
url = "http://selfeed.com/"
if not os.path.isdir('Selfie'):
os.mkdir("Selfie")
os.c... | 25.544118 | 68 | 0.606218 |
a0074b343d6284f8fafcbc9afd5b651255d60daa | 987 | py | Python | nz_django/day6/model_form_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_django/day6/model_form_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_django/day6/model_form_demo/front/views.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from django.shortcuts import render
from .forms import AddBookForm,RegisterForm
from django.http import HttpResponse
from django.views.decorators.http import require_POST
@require_POST
def add_book(request):
form = AddBookForm(request.POST)
if form.is_valid():
# title = form.cleaned_data.get('title')
... | 32.9 | 53 | 0.646403 |
4e623b0fcdc1aa1e19498195849042096dc1429a | 167 | py | Python | PYTHON/Numpy/floor_ceil_and_rint.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Numpy/floor_ceil_and_rint.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | PYTHON/Numpy/floor_ceil_and_rint.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import numpy
na = numpy.array(list(map(float, input().split())))
print(numpy.floor(na))
print(numpy.ceil(na))
print(numpy.rint(na))
| 18.555556 | 51 | 0.712575 |
11b7a2f4a9d6126a696a1b6261cd1f9543e00454 | 583 | py | Python | image.py | pchchv/getqr | f8858d6d539632309841059422004f8f3a6e358e | [
"MIT"
] | null | null | null | image.py | pchchv/getqr | f8858d6d539632309841059422004f8f3a6e358e | [
"MIT"
] | null | null | null | image.py | pchchv/getqr | f8858d6d539632309841059422004f8f3a6e358e | [
"MIT"
] | null | null | null | import abc
class Image:
def __init__(self, border, width, box_size):
self.border = border
self.width = width
self.box_size = box_size
self.pixel_size = (self.width + self.border * 2) * self.box_size
self._image = self.new_image(**kwargs)
@abc.abstractmethod
def new... | 25.347826 | 73 | 0.595197 |
eebf8d294aad17853f234c8327ddcbb1013ab52f | 1,726 | py | Python | app/services/file_services/file_status.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/services/file_services/file_status.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | app/services/file_services/file_status.py | zhiyong-lv/flask-login | d8bf0719bae19ba8f7f44ea6d6a8ca65ba22aa63 | [
"MIT"
] | null | null | null | import logging
import threading
from collections import namedtuple
class Status(type):
FIELD_NAMES = 'name, value'
FIELDS = FIELD_NAMES.replace(',', ' ').split()
def __init__(cls, *args, **kwargs):
cls._lock = threading.Lock()
cls._log = logging.getLogger(__name__)
cls._log.debug(... | 29.254237 | 116 | 0.588644 |
eec4a5631afe3cee06ee6cb668bdd8a2368aab8e | 88 | py | Python | src/onegov/gazette/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/theme/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.gazette.theme.gazette_theme import GazetteTheme
__all__ = ['GazetteTheme']
| 22 | 59 | 0.818182 |
28d1df851d334c6cfb06276b513bc4c80d64e61f | 124 | py | Python | python/python_backup/PRAC_PYTHON/ab18.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/ab18.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/ab18.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def add(a,b):
c=a+b
print"Sum:",c
return
c=input("Enter value:");
d=input("Enter value:");
add(c,d);
| 15.5 | 25 | 0.508065 |
28da8d5a33bd1ec8215b750df7cc792918e4c245 | 255 | py | Python | Imaginary/2021/pwn/Blind_Shell/blind.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Imaginary/2021/pwn/Blind_Shell/blind.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Imaginary/2021/pwn/Blind_Shell/blind.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python3.8
from subprocess import run
if __name__ == "__main__":
while True:
cmd = input(">>> ")
proc = run([cmd], capture_output=True, shell=True, timeout=60)
if proc.returncode == 0:
print("SUCCESS")
else:
print("FAILURE") | 21.25 | 64 | 0.65098 |
c95c3a03c3ee18c82d56323ff454fcab3edc166b | 251 | py | Python | HSCTF/2021/crypto/regulus-satrapa/regulus-satrapa.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | HSCTF/2021/crypto/regulus-satrapa/regulus-satrapa.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | HSCTF/2021/crypto/regulus-satrapa/regulus-satrapa.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | from Crypto.Util.number import *
import binascii
flag = open('flag.txt','rb').read()
p = getPrime(1024)
q = getPrime(1024)
n = p*q
e = 2**16+1
pt = int(binascii.hexlify(flag).decode(),16)
print(p>>512)
print(q%(2**512))
print(n, e)
print(pow(pt,e,n))
| 19.307692 | 44 | 0.657371 |
66e61dc7b6a480ad21dbf4cdd3787f8de89e8794 | 7,134 | py | Python | Utils/py/SimsparkTests/Tests/opp_goal_free_kick.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/SimsparkTests/Tests/opp_goal_free_kick.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/SimsparkTests/Tests/opp_goal_free_kick.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import math
from naoth import BehaviorParser, Framework_Representations_pb2
from AgentController import AgentController
from SimsparkController import SimsparkController
from Utils import *
def position_and_execute(s, a, parser, pos, ball):
# first place the robot! If we run this test multiple times, the robot ... | 45.43949 | 134 | 0.505607 |
662feb40a2847af581a9bec2ca4c30e9167ad45d | 1,378 | py | Python | solution.py | abhiit89/EzeTapProblem | 3a77f64fb7620dd9362ae9967805af673bda1f7f | [
"MIT"
] | null | null | null | solution.py | abhiit89/EzeTapProblem | 3a77f64fb7620dd9362ae9967805af673bda1f7f | [
"MIT"
] | null | null | null | solution.py | abhiit89/EzeTapProblem | 3a77f64fb7620dd9362ae9967805af673bda1f7f | [
"MIT"
] | null | null | null | import json
import operator
with open('data.json') as data_file:
data = json.load(data_file)
def calculateHighest(userList):
max = 0
current = 0
maxitem = None
for item in userList:
current = int(float(item["Day-1"])) + int(float(item["Day-2"])) + int(float(item["Day-3"]))
if curr... | 28.122449 | 103 | 0.577649 |
c676dbabd451e90d7a1f47b7b14f8e469d4aa5ba | 1,424 | py | Python | ___Python/RomanS/untitled/p05_random/m01_wuerfeln.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/RomanS/untitled/p05_random/m01_wuerfeln.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | ___Python/RomanS/untitled/p05_random/m01_wuerfeln.py | uvenil/PythonKurs201806 | 85afa9c9515f5dd8bec0c546f077d8cc39568fe8 | [
"Apache-2.0"
] | null | null | null | import random
r = random.Random()
def wuerfeln():
return r.randint(1,6) # Augenzahl zw 1 und 6
def muenzwurf():
return r.randint(0,1) # 0 = Kopf, 1 = Zahl
print(wuerfeln())
d={}
for i in range (10000):
augenzahl = wuerfeln()
if augenzahl in d:
d[augenzahl] +=1
else:
... | 20.941176 | 83 | 0.604635 |
bbbd6ddc73b01f835cbb7e72530966e13c5e3420 | 5,161 | py | Python | src/onegov/feriennet/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/upgrade.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | """ Contains upgrade tasks that are executed when the application is being
upgraded on the server. See :class:`onegov.core.upgrade.upgrade_task`.
"""
import textwrap
from onegov.core.upgrade import upgrade_task
from onegov.core.utils import module_path
from onegov.feriennet.models import NotificationTemplate
from one... | 28.672222 | 78 | 0.59659 |
b1bc69a9c2f2f9649ee0803d669d448fbff84569 | 984 | py | Python | Codeforces_problems/Number Game/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | Codeforces_problems/Number Game/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | Codeforces_problems/Number Game/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | import math
def is_prime(n):
for i in range(2,int(math.sqrt(n)) +1):
if n%i == 0:
return False
return True
for _ in range(int(input())):
n = int(input())
if n == 1 :
# since for n = 1 Ashishgup cannot make a move
print("FastestFinger")
elif (n > 2 and n%2 ==0):
... | 33.931034 | 91 | 0.557927 |
5948ed4bd47cae595509d64dc8feb87a32d0cf48 | 1,962 | py | Python | m0leCon/2021/Quals/misc/Key-Lottery/server.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | m0leCon/2021/Quals/misc/Key-Lottery/server.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | m0leCon/2021/Quals/misc/Key-Lottery/server.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import os
import random
import string
from flask import Flask, jsonify, render_template, request
app = Flask(__name__)
safe = {}
allowed = set(string.ascii_letters + string.digits + ",")
@app.route("/")
def index():
return render_template("index.html")
@app.route("/guess", methods=["GET", "POST"])
def guess(... | 32.163934 | 155 | 0.607543 |
abf5e37b9e9ee1a72795ba4a813e749195e19ceb | 6,586 | py | Python | app/geetest/geetest.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | null | null | null | app/geetest/geetest.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | 4 | 2020-08-29T16:11:12.000Z | 2022-03-12T00:47:03.000Z | app/geetest/geetest.py | IoTServ/FlaskSimpleCMS | db0fc4464c6d514db14972156ca3e002a60a4876 | [
"MIT"
] | null | null | null | #!coding:utf8
import sys
import random
import json
import requests
import time
from hashlib import md5
if sys.version_info >= (3,):
xrange = range
VERSION = "3.2.0"
class GeetestLib(object):
FN_CHALLENGE = "geetest_challenge"
FN_VALIDATE = "geetest_validate"
FN_SECCODE = "geetest_seccode"
... | 32.93 | 113 | 0.589736 |
f9f08b54e8888e06721eef688f830b8c5fb5359f | 8,049 | py | Python | src/onegov/core/layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/layout.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | import arrow
import babel.dates
import babel.numbers
import isodate
import numbers
import sedate
from cached_property import cached_property
from chameleon import PageTemplate
from datetime import datetime
from functools import lru_cache
from onegov.core import utils
from pytz import timezone
# not yet in upstream: ... | 32.325301 | 79 | 0.625544 |
0557e25dfb893497af74aee0476157d05a1ec825 | 406 | py | Python | Python/M01_ProgrammingBasics/L04_ForLoop/Lab/Solutions/P11_CleverLily.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L04_ForLoop/Lab/Solutions/P11_CleverLily.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | null | null | null | Python/M01_ProgrammingBasics/L04_ForLoop/Lab/Solutions/P11_CleverLily.py | todorkrastev/softuni-software-engineering | cfc0b5eaeb82951ff4d4668332ec3a31c59a5f84 | [
"MIT"
] | 1 | 2022-02-23T13:03:14.000Z | 2022-02-23T13:03:14.000Z | age = int(input())
price = float(input())
toy_price = float(input())
toys = 0
money = 0
given_money = 10
for each in range(1, age + 1):
if each % 2 == 1:
toys += 1
else:
money += given_money - 1
given_money += 10
toy_money = toy_price * toys
total = toy_money + money
if total >= pri... | 17.652174 | 38 | 0.573892 |
fb345314d1ec62879dd19e6788d8809f38f38a6d | 6,142 | py | Python | similaritycalculation/test_spatialSimilarity.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | null | null | null | similaritycalculation/test_spatialSimilarity.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 38 | 2018-10-24T08:51:58.000Z | 2021-12-13T19:54:39.000Z | similaritycalculation/test_spatialSimilarity.py | Geosoft2/Geosoftware-II-AALLH | bdb61d9a1111b9082ec2b9f309998c5f2166975e | [
"MIT"
] | 12 | 2018-10-24T08:20:13.000Z | 2019-08-12T08:10:14.000Z | # Author: Lia Kirsch
import spatialSimilarity
import math
# Geometry
def test_spatialdistance_Geometry():
total = spatialSimilarity.spatialDistance([13.0078125, 50.62507306341435, 5.44921875, 45.82879925192134], [
17.7978515625, 52.09300763963822, 7.27294921875, 46.14... | 46.180451 | 114 | 0.643439 |
32e33ad5fa736d842b9d82426930139508a81026 | 5,942 | py | Python | src/backend/tests.py | marco-koenen/Hackathon-WeVsVirus | 48e8c44a935f728b3bb884dbb6213559742ba569 | [
"MIT"
] | 2 | 2020-03-24T14:12:09.000Z | 2020-03-25T07:43:10.000Z | src/backend/tests.py | marco-koenen/Hackathon-WeVsVirus | 48e8c44a935f728b3bb884dbb6213559742ba569 | [
"MIT"
] | 2 | 2020-03-23T11:56:03.000Z | 2020-03-24T13:50:14.000Z | src/backend/tests.py | marco-koenen/Hackathon-WeVsVirus | 48e8c44a935f728b3bb884dbb6213559742ba569 | [
"MIT"
] | 2 | 2020-03-20T22:00:58.000Z | 2020-03-21T00:11:45.000Z | #!/usr/bin/env python3
import unittest
import requests
import subprocess
import time
HOST = "http://localhost:5000"
HASH_SIZE = 32
example_phone = "491706994326"
example_phone2 = "4917513449251"
#FIXME! how to import the app/config here?
class app():
pass
app.config = {"DEBUG_USER": "debuguser", "DEBUG_PASSWORD... | 34.149425 | 95 | 0.618815 |
fd0559a19091dc6b321dda19f25fca49e4e7a27a | 99 | py | Python | python/Hello.py | campbe13/FizzBuzz | 1ac2b964ef65e792e11947e684f3cc3f8bcaf90d | [
"MIT"
] | null | null | null | python/Hello.py | campbe13/FizzBuzz | 1ac2b964ef65e792e11947e684f3cc3f8bcaf90d | [
"MIT"
] | null | null | null | python/Hello.py | campbe13/FizzBuzz | 1ac2b964ef65e792e11947e684f3cc3f8bcaf90d | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
hello world
P Campbell
February 2018
'''
print ("Hello World from Python")
| 9.9 | 33 | 0.686869 |
9515c81b13460c801040f823c1893da4e1f02464 | 2,591 | py | Python | pyUnnenberg/sstvenc.py | DominikAuras/pyUnnenberg | f3ad87b71ccd25b9231c19e3f4a4f7d1c053028b | [
"MIT"
] | null | null | null | pyUnnenberg/sstvenc.py | DominikAuras/pyUnnenberg | f3ad87b71ccd25b9231c19e3f4a4f7d1c053028b | [
"MIT"
] | null | null | null | pyUnnenberg/sstvenc.py | DominikAuras/pyUnnenberg | f3ad87b71ccd25b9231c19e3f4a4f7d1c053028b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PIL import Image, ImageFont, ImageDraw
from pysstv.color import *
import logging
# module-level logger
ml = logging.getLogger('SSTVEnc')
ml.addHandler(logging.NullHandler())
class SSTVEnc(object):
def __init__(self,**kwargs):
try:
self.font = ImageFo... | 35.986111 | 165 | 0.692011 |
85d8e5616ee9ac2792bbcbb0a9f0d4598af0106d | 232 | py | Python | 2-resources/__CHEAT-SHEETS/cheatsheets-master/cheatsheets-master/dynamodb/python/scan.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 103 | 2019-08-30T10:04:40.000Z | 2022-03-30T22:14:44.000Z | 2-resources/__CHEAT-SHEETS/cheatsheets-master/cheatsheets-master/dynamodb/python/scan.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 6 | 2021-04-08T08:36:27.000Z | 2021-10-01T07:47:17.000Z | 2-resources/__CHEAT-SHEETS/cheatsheets-master/cheatsheets-master/dynamodb/python/scan.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | 51 | 2019-06-10T06:11:46.000Z | 2022-03-30T16:33:05.000Z | import boto3
client = boto3.Session(region_name='eu-west-1').client('dynamodb', aws_access_key_id='', aws_secret_access_key='', endpoint_url='http://localhost:4567')
response = client.scan(TableName='gamescores')
print(response)
| 29 | 152 | 0.767241 |
c06f7526450b978b812a44193dc8013dc8477971 | 65 | py | Python | db/create.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | null | null | null | db/create.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | null | null | null | db/create.py | JarSaa/BootDemo2 | 3ad61e25026a26fbd5ed2f0e9cc9cdc56696e805 | [
"MIT"
] | null | null | null | def create_db(base, engine):
base.metadata.create_all(engine) | 32.5 | 36 | 0.769231 |
b55986819c020b7a86b7a3b49b0a9a2be5770619 | 1,161 | py | Python | Unknown/dyc/magic/main.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 22 | 2018-08-07T06:55:10.000Z | 2021-06-12T02:12:19.000Z | Unknown/dyc/magic/main.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 28 | 2020-03-04T23:47:22.000Z | 2022-02-26T18:50:00.000Z | Unknown/dyc/magic/main.py | Wycers/Codelib | 86d83787aa577b8f2d66b5410e73102411c45e46 | [
"MIT"
] | 4 | 2019-11-09T15:41:26.000Z | 2021-10-10T08:56:57.000Z | import queue
def kt(a):
fac = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880]
res = 0
for i in range(8):
x = 0
for j in range(i + 1, 8):
if a[j] < a[i]:
x = x + 1
res = res + fac[8 - i - 1] * x
return res
q = queue.Queue()
q.put((range(1, 9), 0))
ans... | 21.90566 | 67 | 0.455642 |
a90bb1a504bce362256211c550bf6b47abc2d042 | 353 | py | Python | pacman-arch/test/pacman/tests/sync041.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/sync041.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/sync041.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Install two conflicting targets"
sp1 = pmpkg("pkg1")
sp1.conflicts = ["pkg2"]
sp2 = pmpkg("pkg2")
sp2.conflicts = ["pkg1"]
for p in sp1, sp2:
self.addpkg2db("sync", p);
self.args = "-S %s" % " ".join([p.name for p in (sp1, sp2)])
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=pkg1")... | 20.764706 | 60 | 0.66289 |
a5c70c6d55144d34f52a9b41121214f4ced01de9 | 997 | py | Python | Kaggle-Competitions/CrowdFlower/scripts/features.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:16:23.000Z | 2019-05-10T09:16:23.000Z | Kaggle-Competitions/CrowdFlower/scripts/features.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | null | null | null | Kaggle-Competitions/CrowdFlower/scripts/features.py | gopala-kr/ds-notebooks | bc35430ecdd851f2ceab8f2437eec4d77cb59423 | [
"MIT"
] | 1 | 2019-05-10T09:17:28.000Z | 2019-05-10T09:17:28.000Z | from scipy import sparse
import numpy as np
from sklearn.base import BaseEstimator
import pandas as pd
class FeatureStacker(BaseEstimator):
def __init__(self, transformer_list):
self.transformer_list = transformer_list
def get_feature_names(self):
pass
def fit(self, X, y=None):
for name, trans in self.trans... | 22.659091 | 62 | 0.72016 |
5755b1366bc46a00ea03172a9e5b8e599dc6f844 | 2,326 | py | Python | .circleci/checklhe/usefulstuff.py | tmartini/JHUGen | 80da31668d7b7eb5b02bb4cac435562c45075d24 | [
"Apache-2.0"
] | 3 | 2015-06-08T13:09:28.000Z | 2020-09-04T19:59:36.000Z | .circleci/checklhe/usefulstuff.py | tmartini/JHUGen | 80da31668d7b7eb5b02bb4cac435562c45075d24 | [
"Apache-2.0"
] | 64 | 2015-06-24T15:08:17.000Z | 2022-01-25T04:59:32.000Z | .circleci/checklhe/usefulstuff.py | tmartini/JHUGen | 80da31668d7b7eb5b02bb4cac435562c45075d24 | [
"Apache-2.0"
] | 19 | 2015-05-04T22:15:41.000Z | 2021-07-06T10:04:40.000Z | from math import isinf, isnan
class printablelist(list):
def __str__(self, joiner = ", "):
return "[" + joiner.join(str(a) for a in self) + "]"
def __getitem__(self, key):
if isinstance(key, slice):
return printablelist(super(printablelist, self).__getitem__(key))
return sup... | 49.489362 | 121 | 0.621238 |
1930b8d94cfead37bb68e9fc81391fce769e0dd1 | 1,813 | py | Python | notebooks/1-workflow/model/pipeline_invoke_python.py | data-science-workshops/machine-learning-workflow | b7880ccc6c573ee2e8d5d4353e22a2f3a1f45d13 | [
"MIT"
] | null | null | null | notebooks/1-workflow/model/pipeline_invoke_python.py | data-science-workshops/machine-learning-workflow | b7880ccc6c573ee2e8d5d4353e22a2f3a1f45d13 | [
"MIT"
] | null | null | null | notebooks/1-workflow/model/pipeline_invoke_python.py | data-science-workshops/machine-learning-workflow | b7880ccc6c573ee2e8d5d4353e22a2f3a1f45d13 | [
"MIT"
] | null | null | null | import os
from pandas.io.json import json_normalize
from pipeline_monitor import prometheus_monitor as monitor
from pipeline_logger import log
import ujson
import cloudpickle as pickle
import logging
_logger = logging.getLogger('pipeline-logger')
_logger.setLevel(logging.INFO)
_logger_stream_handler = logging.StreamHa... | 26.275362 | 90 | 0.739106 |
5ffcc693eef1825dd57c6243fa27ee0127f5b46a | 8,357 | py | Python | storedata.py | qismib/QuaKe | dff8cb682077181da071b80f93b47ec3d630bc4a | [
"MIT"
] | 2 | 2022-02-09T21:50:30.000Z | 2022-02-14T07:41:47.000Z | storedata.py | qismib/QuaKe | dff8cb682077181da071b80f93b47ec3d630bc4a | [
"MIT"
] | 4 | 2022-03-01T15:58:38.000Z | 2022-03-31T10:19:18.000Z | storedata.py | qismib/QuaKe | dff8cb682077181da071b80f93b47ec3d630bc4a | [
"MIT"
] | null | null | null | """
This module reads events from files and stores histograms.
Usage:
```
python storedata <input> -o <output> [--show]
```
The `--show` optional flag allows to show a plot taken from each file in the
dataset folder.
"""
import argparse
from pathlib import Path
from time import time a... | 35.113445 | 85 | 0.589685 |
2724e06d638f32018ffab375c03a2881f2a46645 | 17 | py | Python | addfile.py | s0ber23/hackt0berf3st | 2575d7e3ecece785d84890e3c9a8ae9d08acc2cc | [
"MIT"
] | null | null | null | addfile.py | s0ber23/hackt0berf3st | 2575d7e3ecece785d84890e3c9a8ae9d08acc2cc | [
"MIT"
] | null | null | null | addfile.py | s0ber23/hackt0berf3st | 2575d7e3ecece785d84890e3c9a8ae9d08acc2cc | [
"MIT"
] | 3 | 2020-10-20T05:50:08.000Z | 2020-10-20T06:08:06.000Z | print("addfile")
| 8.5 | 16 | 0.705882 |
fdf02a5c223a3cf1878519d0daa6cd6adaebc32c | 234 | py | Python | python/python_backup/COMP_CDCF/LRobotBunny.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/COMP_CDCF/LRobotBunny.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/COMP_CDCF/LRobotBunny.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | def p():
for i in range(T):
for j in range(4):
print(A[i][j],end=" ")
print()
A=[0][0]*100
T=int(input("Enter T"))
for i in range(T):
for j in range(4):
A[i][j]=int(input("Enter a number :"))
p()
| 11.7 | 41 | 0.482906 |
7bea4307f60d38c909bc73fc993d06985373d4cf | 3,019 | py | Python | campixx_2019_notebooks/helpers/helpers.py | Jonnyblacklabel/seo_campixx_2019 | b91105fb85b2dab35780d6064a8a2f0f3f36440c | [
"MIT"
] | null | null | null | campixx_2019_notebooks/helpers/helpers.py | Jonnyblacklabel/seo_campixx_2019 | b91105fb85b2dab35780d6064a8a2f0f3f36440c | [
"MIT"
] | 2 | 2020-03-24T17:05:39.000Z | 2020-03-31T02:10:24.000Z | campixx_2019_notebooks/helpers/helpers.py | Jonnyblacklabel/seo_campixx_2019 | b91105fb85b2dab35780d6064a8a2f0f3f36440c | [
"MIT"
] | null | null | null | # =============================================================================
# gsc calc and assign
# =============================================================================
def assign_pos_imp(df):
"""Calculate pos_imp for weighted position
Arguments:
df -- source DataFrame
"""
return df.assign(p... | 28.752381 | 96 | 0.525671 |
d0998624530e1882905346b663ccba9fac54ef81 | 603 | py | Python | turngen/ai_alphazero.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | turngen/ai_alphazero.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | turngen/ai_alphazero.py | amrohendawi/AlphaZero-implementation | 42103e63308ba256208b6dd6ddcbef2e797e9932 | [
"MIT"
] | null | null | null | import state as s
import numpy as np
import game as g
import turn as t
from ai_base import ai_base
from turngen import TurnGen
from alphazero.NeuralNet import NeuralNet
class ai_alphazero(ai_base):
def __init__(self, player):
super().__init__(player)
self.NN = NeuralNet()
self.game = g.Game()
def loadAI(sel... | 20.1 | 60 | 0.71476 |
4bcfd0a8e5eeb8a600203b9ffcdb62d1318cc012 | 92 | py | Python | 2014/11/table-mine-fines/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/11/mine-injury-rate/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/11/mine-injury-rate/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1MNlRJz1wWaDFvDX4riMu1a5AW_TDh_vWnNQ5ly61a6c'
| 23 | 68 | 0.847826 |
322b41231f4373d6e92a9f9f5384b06d39362aee | 852 | py | Python | etc code/add_image.py | gusghrlrl101/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | 11 | 2019-06-17T02:59:01.000Z | 2021-05-24T14:10:04.000Z | etc code/add_image.py | RabbitG29/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | null | null | null | etc code/add_image.py | RabbitG29/Dance-Helper | e9f5f6168f1dc6944c25cc8ff7eb829791fe484c | [
"MIT"
] | 3 | 2019-06-17T02:59:32.000Z | 2019-07-03T04:31:30.000Z | import cv2
import os
from glob import glob
# codec
#fourcc = cv2.VideoWriter_fourcc(*'DIVX')
#out = cv2.VideoWriter('result2.avi', fourcc, 24.0, (1280, 720))
# video
#cap = cv2.VideoCapture('../../../image/user4.mp4')
# image
i = 0
img_paths = sorted(glob('*[0-9].png'))
img_paths_original = sorted(glob('img/*[0-9].p... | 24.342857 | 65 | 0.681925 |
08a1a890d0612bf2deea5b4c1d7529f449ef8bbe | 443 | py | Python | pacman-arch/test/pacman/tests/sync110.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/sync110.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/sync110.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Sysupgrade of a package pulling new dependencies"
sp1 = pmpkg("pkg1", "1.0-2")
sp1.depends = ["pkg2"]
sp2 = pmpkg("pkg2")
sp2.depends = ["pkg3"]
sp3 = pmpkg("pkg3")
for p in sp1, sp2, sp3:
self.addpkg2db("sync", p)
lp1 = pmpkg("pkg1")
self.addpkg2db("local", lp1)
self.args = "-Su"
self.addru... | 19.26087 | 69 | 0.665914 |
08d4554ac31e5bc970ff946824729e605211b7e9 | 5,130 | py | Python | SuperRandCMDs/plugin.py | jztech101/Loggy | 1883a09ebbb6c8120cae648aebeb2771e7f39d9b | [
"MIT"
] | null | null | null | SuperRandCMDs/plugin.py | jztech101/Loggy | 1883a09ebbb6c8120cae648aebeb2771e7f39d9b | [
"MIT"
] | 6 | 2018-02-09T18:39:37.000Z | 2018-08-31T18:40:02.000Z | SuperRandCMDs/plugin.py | jztech101/Loggy | 1883a09ebbb6c8120cae648aebeb2771e7f39d9b | [
"MIT"
] | null | null | null |
import supybot.utils as utils
from supybot.commands import *
import supybot.plugins as plugins
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
import supybot.callbacks as callbacks
import supybot.schedule as schedule
import time
try:
from supybot.i18n import PluginInternationalization
_ =... | 45 | 120 | 0.583041 |
deef86ab9b07789a48caaa6c85ae3b1628578629 | 3,652 | py | Python | 2020-09-03-1600-gma_becherhalter.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-03-1600-gma_becherhalter.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-03-1600-gma_becherhalter.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 3 12:07:10 2020
@author: Georg Maubach
Programmieren Sie eine Klasse Becherhalter,
die maximal zwei Becher halten kann.
Implementieren Sie einen Konstruktor mit
entsprechenden Standardargumenten.
Implementieren Sie die Zugriffsmethoden
getPlatz1 und getPlatz2.... | 28.53125 | 69 | 0.581599 |
720da48109168ef45831022f3451931681a5e02e | 6,062 | py | Python | Packs/CarbonBlackEnterpriseEDR/Integrations/CarbonBlackEnterpriseEDR/CarbonBlackEnterpriseEDR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CarbonBlackEnterpriseEDR/Integrations/CarbonBlackEnterpriseEDR/CarbonBlackEnterpriseEDR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CarbonBlackEnterpriseEDR/Integrations/CarbonBlackEnterpriseEDR/CarbonBlackEnterpriseEDR_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import pytest
import CarbonBlackEnterpriseEDR as cbe
import demistomock as demisto
from freezegun import freeze_time
PROCESS_CASES = [
(
{'process_hash': '63d423ea882264dbb157a965c200306212fc5e1c6ddb8cbbb0f1d3b51ecd82e6',
'process_name': None, 'event_id': None, 'query': None, 'limit': 20, 'start_t... | 34.83908 | 120 | 0.652095 |
dfb7f33467c01647131c4526e088e99714ffc8d1 | 2,113 | py | Python | NMC/NeuroML2/Examples.py | OpenSourceBrain/BlueBrainProjectShowcase | 2cd8aa77342576c1a871f5d500d791f927444913 | [
"MIT"
] | 26 | 2015-08-17T19:30:52.000Z | 2021-03-12T20:39:19.000Z | NMC/NeuroML2/Examples.py | OpenSourceBrain/BlueBrainProjectShowcase | 2cd8aa77342576c1a871f5d500d791f927444913 | [
"MIT"
] | 9 | 2015-01-15T20:16:08.000Z | 2017-05-18T20:53:52.000Z | NMC/NeuroML2/Examples.py | OpenSourceBrain/BlueBrainProjectShowcase | 2cd8aa77342576c1a871f5d500d791f927444913 | [
"MIT"
] | 18 | 2015-08-17T19:30:56.000Z | 2022-03-04T06:01:30.000Z |
from pyneuroml import pynml
from neuroml import *
import os
import math
max_per_layer = 100
layers = ['L1','L23', 'L4', 'L5', 'L6']
radius = 210.0
t1=-165.0
t2=-149.0
t3=-353.0
t4=-190.0
t5=-526.0
t6=-700.0
ys = {}
ys['L1']=[0,t1]
ys['L23']=[t1,t1+t2+t3]
ys['L4']=[t1+t2+t3,t1+t2+t3+t4]
ys['L5']=[t1+t2+t3+t4,t1+t2+... | 25.768293 | 87 | 0.662565 |
5f266785c5afe724485e07db418ead6b3134ca73 | 42,033 | py | Python | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/coremodules/network/netconvert.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 4 | 2020-11-13T02:35:56.000Z | 2021-03-29T20:15:54.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/coremodules/network/netconvert.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 9 | 2020-12-09T02:12:39.000Z | 2021-02-18T00:15:28.000Z | Co-Simulation/Sumo/sumo-1.7.0/tools/contributed/sumopy/coremodules/network/netconvert.py | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | 1 | 2020-11-20T19:31:26.000Z | 2020-11-20T19:31:26.000Z | # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2016-2020 German Aerospace Center (DLR) and others.
# SUMOPy module
# Copyright (C) 2012-2017 University of Bologna - DICAM
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public ... | 49.276671 | 221 | 0.48638 |
a05a618ecbdb0e6acde82bf6ba0e14c6e0ebaac3 | 346 | py | Python | src/experiment/info.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 2 | 2018-04-27T09:02:15.000Z | 2019-04-19T19:12:13.000Z | src/experiment/info.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | 1 | 2019-04-19T19:13:08.000Z | 2021-02-22T21:29:55.000Z | src/experiment/info.py | kaphka/imi-master-thesis | 2331a3534dc32e30a1333bb21c68c1e1b07ec9e4 | [
"MIT"
] | null | null | null |
class LogInfo():
def __init__(self, name='info', conv=''):
self._log_name = name
self._conf_str = conv
@property
def log_name(self):
return self._log_name + self.conf_str
@property
def name(self):
return self._log_name
@property
def conf_str(self):
... | 16.47619 | 45 | 0.598266 |
3e2a18a0c5dca6dba2ac40d2c0e1d0f039dc6195 | 785 | py | Python | Projects/CLI-Txt-Adventure/enemies.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 37 | 2020-10-01T15:20:12.000Z | 2021-10-04T14:17:06.000Z | Projects/CLI-Txt-Adventure/enemies.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 27 | 2020-10-01T12:32:41.000Z | 2021-10-04T11:05:34.000Z | Projects/CLI-Txt-Adventure/enemies.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 57 | 2020-10-01T11:24:26.000Z | 2022-02-16T05:09:50.000Z | class Enemy:
def __init__(self):
raise NotImplementedError("Do not create raw Enemy objects.")
def __str__(self):
return self.name
def is_alive(self):
return self.hp > 0
def is_dead(self):
return self.hp < 0
class Ghost(Enemy):
def __init__(self):
self.na... | 19.625 | 69 | 0.579618 |
3e50cd86c1fe5070d65f40ce9f3dd6d8b6171d5d | 10,314 | py | Python | Imaginary/2021/web/aMAZEing-challenge/maze.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | Imaginary/2021/web/aMAZEing-challenge/maze.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | Imaginary/2021/web/aMAZEing-challenge/maze.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | import random
from os import system
from time import sleep
from solver import solve
START_POS = (1, 1)
MIN_STEPS = 2
WALL = "▓▓"
NEWLINE = "\n"
CLEAR = " "
FLAG = "{}"
PLAYER = "[]"
WALL_ALT = "##"
NEWLINE_ALT = "n"
UP, LEFT, DOWN, RIGHT = "w", "a", "s", "d"
class Maze:
def __init__(self, size=(79,39), data... | 34.152318 | 1,941 | 0.609948 |
3e5ce3424b57c1ed948cc5af6ed332e40f88bf4d | 601 | py | Python | python_experiments/config.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 8 | 2020-04-14T23:17:00.000Z | 2021-06-21T12:34:04.000Z | python_experiments/config.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | null | null | null | python_experiments/config.py | RapidsAtHKUST/SimRank | 3a601b08f9a3c281e2b36b914e06aba3a3a36118 | [
"MIT"
] | 1 | 2021-01-17T16:26:50.000Z | 2021-01-17T16:26:50.000Z | import os, json
exec_path_tag = 'our_exec_path'
data_set_path_tag = 'data_set_path'
lccpu12_tag = 'lccpu12'
thread_num_tag = 'thread_num'
thread_num_lst_tag = 'thread num lst'
data_set_lst_tag = 'data_set_lst'
gt_data_set_lst_tag = 'gt_data_set_lst'
exp_res_root_path_tag = 'exp_res_root_path'
exp_res_root_mount_pat... | 26.130435 | 59 | 0.772047 |
e4b9bbee9993542279b9cc87010b8491b2cc5a39 | 1,246 | py | Python | template/python-library/setup.py | gbesancon/projects | 7a9da629dddcf21fbe5c043d86b00036f80cbe14 | [
"MIT"
] | null | null | null | template/python-library/setup.py | gbesancon/projects | 7a9da629dddcf21fbe5c043d86b00036f80cbe14 | [
"MIT"
] | 1 | 2022-03-02T10:43:58.000Z | 2022-03-02T10:43:58.000Z | template/python-library/setup.py | gbesancon/projects | 7a9da629dddcf21fbe5c043d86b00036f80cbe14 | [
"MIT"
] | null | null | null | import os
import re
from setuptools import setup, find_packages
__version__ = None
with open('pl/__init__.py') as f:
exec(f.read())
if "VERSION" in os.environ:
if os.environ["VERSION"]:
__version__ = os.environ["VERSION"]
# Convert version from Semantic Version into PEP 440
pattern = re.compile(r"""... | 30.390244 | 115 | 0.656501 |
5fc21477ca043711d17869ca1f23d22e89f9a328 | 6,406 | py | Python | kafka/cruise-control/cruise-control-client/cruisecontrolclient/client/Responder.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 2,177 | 2017-08-28T15:07:01.000Z | 2022-03-30T11:06:01.000Z | kafka/cruise-control/cruise-control-client/cruisecontrolclient/client/Responder.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 1,079 | 2017-08-30T07:25:06.000Z | 2022-03-31T17:49:07.000Z | kafka/cruise-control/cruise-control-client/cruisecontrolclient/client/Responder.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 489 | 2017-08-28T16:17:03.000Z | 2022-03-31T15:52:18.000Z | # Copyright 2019 LinkedIn Corp. Licensed under the BSD 2-Clause License (the "License").
# See License in the project root for license information.
# Use convenience function to redirect printing to stderr
from cruisecontrolclient.util.print import print_error
# To be able to use the Endpoint class to retrieve a resp... | 44.17931 | 115 | 0.58773 |
4b0d625e308cea07553e30843101a01f4fbf1423 | 2,876 | py | Python | suchalgorithmen/binary_search.py | InformatikNinja/algorithmen | 8d06188a4ecb306ade34a310c6a0908aad102cca | [
"Apache-2.0"
] | 1 | 2018-11-09T12:46:36.000Z | 2018-11-09T12:46:36.000Z | suchalgorithmen/binary_search.py | InformatikNinja/algorithmen | 8d06188a4ecb306ade34a310c6a0908aad102cca | [
"Apache-2.0"
] | null | null | null | suchalgorithmen/binary_search.py | InformatikNinja/algorithmen | 8d06188a4ecb306ade34a310c6a0908aad102cca | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Sortieralgorithmus: Binäre Suche (binary search).
Weitere Informationen findest du auf:
https://informatik-ninja.de/post/suchalgorithmen-binaere-suche-binary-search
"""
def binary_search_start(A, key):
"""Binäre Suche mit Rekursion.
Startet die Rekursion.
Args:
A (lis... | 28.76 | 95 | 0.596662 |
8a76fb8b5ae4d539ede3484b84730c21456089af | 627 | py | Python | lib/log.py | wchming1987/Tumbler | e309771779c8eb44e685adbb691a428d29009e05 | [
"Apache-2.0"
] | null | null | null | lib/log.py | wchming1987/Tumbler | e309771779c8eb44e685adbb691a428d29009e05 | [
"Apache-2.0"
] | null | null | null | lib/log.py | wchming1987/Tumbler | e309771779c8eb44e685adbb691a428d29009e05 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding=utf-8 -*-
from os import access, path, R_OK
import os
import logging
from logging.config import fileConfig
log_config_path = os.path.join(os.path.dirname(os.getcwd()), 'config', 'logging.conf')
if path.exists(log_config_path) and path.isfile(log_config_path) and access(log_config_... | 33 | 99 | 0.77193 |
0a8f2a4ce86fcc1ed7c1e3e20f78313cc9dd36b8 | 1,515 | py | Python | pandasguide/com/aaron/app.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | pandasguide/com/aaron/app.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | 2 | 2021-03-25T22:00:07.000Z | 2022-01-20T15:51:48.000Z | pandasguide/com/aaron/app.py | qsunny/python | ace8c3178a9a9619de2b60ca242c2079dd2f825e | [
"MIT"
] | null | null | null | import pandas as pd
import logging
import json
logging.basicConfig(
filename='application.log',
level=logging.WARNING,
format= '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s',
datefmt='%H:%M:%S'
)
if __name__ == '__main__':
# csv_file_path = 'C:/Users/Administrator/Desktop/... | 34.431818 | 126 | 0.567657 |
0afd6620b2938a44f02ef07d9a58e03a98021949 | 10,545 | py | Python | Packs/Anomali_Enterprise/Integrations/Anomali_Enterprise/Anomali_Enterprise.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/Anomali_Enterprise/Integrations/Anomali_Enterprise/Anomali_Enterprise.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/Anomali_Enterprise/Integrations/Anomali_Enterprise/Anomali_Enterprise.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | from typing import Dict, List
import urllib3
from CommonServerPython import *
# Disable insecure warnings
urllib3.disable_warnings()
VENDOR_NAME = 'Anomali Enterprise'
''' CLIENT CLASS '''
class Client(BaseClient):
"""
Client to use in the Anomali Enterprise integration. Overrides BaseClient
"""
... | 34.016129 | 123 | 0.613656 |
7c439ce047d068dbc93a34d2d52c56020ecaf94b | 874 | py | Python | backend/apps/iamstudent/migrations/0018_auto_20200522_1339.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 2 | 2020-03-28T13:56:39.000Z | 2020-03-29T10:16:12.000Z | backend/apps/iamstudent/migrations/0018_auto_20200522_1339.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | 76 | 2020-03-27T21:53:04.000Z | 2020-03-30T20:27:43.000Z | backend/apps/iamstudent/migrations/0018_auto_20200522_1339.py | match4healthcare/match4healthcare | acf69e3b781d715f0a947c2a9df6646e94f1ca6b | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-05-22 13:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('iamstudent', '0017_auto_20200502_2032'),
]
operations = [
migrations.AlterField(
model_name='studentlistfiltermodel',
... | 36.416667 | 277 | 0.646453 |
7c9cd8af1dc7ab5e20ffd6dda359e59df2604590 | 1,845 | py | Python | QuaternionProcessor.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | QuaternionProcessor.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | QuaternionProcessor.py | manpreet-singh/DataCollectionPackage | 996546b9062c969c2af3a60b35445077f70641c2 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.animation as animation
import numpy as np
import getpass
from pyquaternion import Quaternion
data = np.genfromtxt('data.csv', delimiter=',')
print(data[1][4:8])
x_axis = np.array([1, 0, 0])
y_axis = np.array([0, 1, 0])
z_axi... | 32.946429 | 113 | 0.60542 |
7caf40c0d1d37e5fcfba7c1c02d3e0885f5c37a6 | 476 | py | Python | basics/update_var.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | 1 | 2019-04-07T23:14:29.000Z | 2019-04-07T23:14:29.000Z | basics/update_var.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | basics/update_var.py | karinakozarova/Learning-Python | 217dfc8ca6931a238445daf0b84e188c02916c52 | [
"MIT"
] | null | null | null | january_to_june_rainfall = 1.93 + 0.71 + 3.53 + 3.41 + 3.69 + 4.50
annual_rainfall = january_to_june_rainfall
july_rainfall = 1.05
annual_rainfall += july_rainfall
august_rainfall = 4.91
annual_rainfall += august_rainfall
september_rainfall = 5.16
annual_rainfall += september_rainfall
october_rainfall = 7.20
annual... | 22.666667 | 66 | 0.80042 |
861f76d269249d5ad29ed8b79a4fe738116bed05 | 2,504 | py | Python | packages/std/nodes/std___If0/std___If0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/std/nodes/std___If0/std___If0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | packages/std/nodes/std___If0/std___If0___METACODE.py | Shirazbello/Pyscriptining | 0f2c80a9bb10477d65966faeccc7783f20385c1b | [
"MIT"
] | null | null | null | from custom_src.NodeInstance import NodeInstance
from custom_src.Node import Node
# USEFUL
# self.input(index) <- access to input data
# self.outputs[index].set_val(val) <- set output data port value
# self.main_widget <- access to main widget
# self.exec_output(index) ... | 37.939394 | 138 | 0.682109 |
8667178284d0dd6e9fd07cd3b4190a4c236de1b9 | 19,491 | py | Python | Packs/Active_Directory_Query/Integrations/Active_Directory_Query/Active_Directory_Query_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | null | null | null | Packs/Active_Directory_Query/Integrations/Active_Directory_Query/Active_Directory_Query_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 60 | 2022-02-24T14:54:47.000Z | 2022-03-31T10:38:41.000Z | Packs/Active_Directory_Query/Integrations/Active_Directory_Query/Active_Directory_Query_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | null | null | null | import demistomock as demisto
from Active_Directory_Query import main, group_dn
import socket
import ssl
from threading import Thread
import time
import os
import pytest
import json
from IAMApiModule import *
from unittest.mock import patch
BASE_TEST_PARAMS = {
'server_ip': '127.0.0.1',
'secure_connection': '... | 37.627413 | 120 | 0.620081 |
869be5b2e7448c8156a2e6834c20eaf0e69e9017 | 3,912 | py | Python | tasks/migrations/0001_initial.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | 3 | 2020-03-21T22:32:56.000Z | 2020-03-28T23:06:38.000Z | tasks/migrations/0001_initial.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | tasks/migrations/0001_initial.py | abernten/website | 89167c5b1914953ac67def01b9ec0c169c50658f | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-03-28 22:43
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('erntehelfer', '0001_initial'),
]
operations = [
migration... | 55.098592 | 222 | 0.617843 |
86afd147eaf4b198c1f51cb3a2ea1823e7e82aa7 | 576 | py | Python | exercises/de/solution_04_10.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/solution_04_10.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/solution_04_10.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | TRAINING_DATA = [
(
"ich war letztes jahr in amsterdem und die kanäle warn superschön",
{"entities": [(24, 33, "LOC")]},
),
(
"Du solltest einmal im Leben Paris besuchen, aber der Eiffelturm ist relativ langweilig",
{"entities": [(28, 33, "LOC")]},
),
(
"Es gi... | 30.315789 | 100 | 0.538194 |
86ea24580816e7092cdabee2f3d50364be15a8ef | 5,074 | py | Python | suds/options.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-22T23:34:03.000Z | 2022-03-31T09:31:34.000Z | suds/options.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 317 | 2018-10-05T23:51:48.000Z | 2022-03-22T17:38:52.000Z | suds/options.py | koocieyu/interactive-tutorials | 873851b37f0a13b6218ba1e656d51169010981fe | [
"Apache-2.0"
] | 46 | 2018-10-10T18:55:00.000Z | 2022-03-28T07:27:04.000Z | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | 40.919355 | 86 | 0.572921 |
ed4d4bd5e50b8b634ad36a74b121ab7d5f96eff4 | 735 | py | Python | misc/sympy_play/rmp_from_GDS_jl_sympy.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | misc/sympy_play/rmp_from_GDS_jl_sympy.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | misc/sympy_play/rmp_from_GDS_jl_sympy.py | YoshimitsuMatsutaIe/hoge_flow_test | 22e2e2ce043a3107bd06449f6f9958641293e414 | [
"MIT"
] | null | null | null | import sympy as sy
q, dq, q_min, q_max, sigma, alpha_u, alpha_l = sy.symbols('q, dq, q_min, q_max, sigma, alpha_u, alpha_l')
# def jl_alpha_upper(dq, sigma):
# return 1 - sy.exp(-(max(dq, 0) ** 2) / (2 * sigma ** 2))
# def jl_alpha_lower(dq, sigma):
# return 1 - sy.exp(-(min(dq, 0) ** 2) / (2 * sigma ... | 20.416667 | 105 | 0.548299 |
13293507adec7e38e03d52dbc55b2aa01de9d918 | 15,408 | py | Python | venv/lib/python3.7/site-packages/twilio/rest/api/v2010/account/address/dependent_phone_number.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 3 | 2020-12-14T03:29:02.000Z | 2020-12-24T22:04:48.000Z | venv/lib/python3.7/site-packages/twilio/rest/api/v2010/account/address/dependent_phone_number.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | 1 | 2021-08-21T22:54:01.000Z | 2021-08-23T19:39:42.000Z | venv/lib/python3.7/site-packages/twilio/rest/api/v2010/account/address/dependent_phone_number.py | uosorio/heroku_face | 7d6465e71dba17a15d8edaef520adb2fcd09d91e | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page ... | 34.938776 | 121 | 0.638954 |
1356e053a8ef32d510dae918ca0a819beebada3d | 965 | py | Python | convert.py | fred1234/BDLC_FS22 | 9db012026bfa1b8672bb4c62558b3beac4baff98 | [
"MIT"
] | 1 | 2022-02-24T12:47:23.000Z | 2022-02-24T12:47:23.000Z | convert.py | fred1234/BDLC_FS22 | 9db012026bfa1b8672bb4c62558b3beac4baff98 | [
"MIT"
] | null | null | null | convert.py | fred1234/BDLC_FS22 | 9db012026bfa1b8672bb4c62558b3beac4baff98 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
print("hi")
with open("Result.json", "w") as r:
with open('Comments.json') as f:
for index, line in enumerate(f):
line = list(line)
# first line, we need to append ']' at the end
if(line[0] == '['):
line[-1] = ']'
... | 31.129032 | 98 | 0.415544 |
b9b81375edfbd315f17acbd0479532bad0f0dcdc | 1,043 | py | Python | tests/utilities.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 1 | 2020-09-12T17:27:21.000Z | 2020-09-12T17:27:21.000Z | tests/utilities.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | 52 | 2020-10-03T11:58:14.000Z | 2022-02-01T13:17:52.000Z | tests/utilities.py | chaneyjd/rasa | 104a9591fc10b96eaa7fe402b6d64ca652b7ebe2 | [
"Apache-2.0"
] | null | null | null | from yarl import URL
from typing import Text
import rasa.shared.utils.io
import rasa.utils.io as io_utils
from rasa.nlu.classifiers.diet_classifier import DIETClassifier
from rasa.nlu.selectors.response_selector import ResponseSelector
from rasa.utils.tensorflow.constants import EPOCHS
def latest_request(mocked, re... | 29.8 | 77 | 0.737296 |
16aa0e56ffb44f806d42db5b04ed03a713c71f0d | 8,435 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/storage/netapp/na_cdot_svm.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/storage/netapp/na_cdot_svm.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/storage/netapp/na_cdot_svm.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# (c) 2017, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
... | 33.472222 | 123 | 0.565382 |
4c1f65fb4b5000979ca45290e5cc2e31bb1ea97b | 996 | py | Python | exercises/es/test_04_11_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/es/test_04_11_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/es/test_04_11_02.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
len(TRAINING_DATA) == 3
), "Parece que hay algo mal con los datos. Esperaba 3 ejemplos."
assert all(
len(entry) == 2 and isinstance(entry[1], dict) for entry in TRAINING_DATA
), "Formato incorrecto de los datos de entrenamiento. Esperaba una lista de tuples dónde el ... | 41.5 | 125 | 0.635542 |
4c71d0d7c25e7978f7dda77ededbff51f6515b6f | 1,903 | py | Python | Technical_Indicator_Supertrend.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | Technical_Indicator_Supertrend.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | Technical_Indicator_Supertrend.py | sonomarina/Stock-sentiment-analysis | 2b3ddd88c73916ea06d39ef5d455f9220c69fdf7 | [
"Unlicense"
] | null | null | null | # =============================================================================
# Import OHLCV data and calculate ATR and Supertrend technical indicators
# Author : Mayank Rasu
# Please report bug/issues in the Q&A section
# =============================================================================
# Import... | 44.255814 | 137 | 0.532843 |
d5be63120f771928b884c364bc1d9ed3f96f9304 | 938 | py | Python | 2020-09-02-1137-gma_istSchaltjahr.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-02-1137-gma_istSchaltjahr.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | 2020-09-02-1137-gma_istSchaltjahr.py | gmaubach/OOP-with-Python | 9b059e911d55d616e756324564f1f2cc524aa53d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 2 11:24:10 2020
@author: Georg Maubach
Schreiben Sie eine Funktion isSchaltjahr(), der ein Jahr übergeben wird
und die dann zurückgibt, ob das Jahr ein Schaltjahr ist oder nicht.
Definition Schaltjahr:
- Wenn ein Jahr durch 4 teilbar ist, ist es ein Schaltjahr... | 27.588235 | 78 | 0.618337 |
91049613b388a9dedd0519385d6d0877b9d1b521 | 578 | py | Python | exercises/en/test_03_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/en/test_03_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/en/test_03_07.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | def test():
assert (
'after="ner"' in __solution__
), "Are you adding the component explicitly after the entity recognizer?"
assert (
nlp.pipe_names[6] == "animal_component"
), "Did you add the component after the entity recognizer?"
assert len(doc.ents) == 2, "Are you adding the ent... | 34 | 77 | 0.636678 |
915262f4e7ca4961a3c59cde57c66bcd3e112bc2 | 617 | py | Python | src/onegov/directory/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/directory/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/directory/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.directory.archive import DirectoryArchive, DirectoryZipArchive
from onegov.directory.models import Directory, DirectoryEntry
from onegov.directory.collections import DirectoryCollection
from onegov.directory.collections import DirectoryEntryCollection
from onegov.directory.types import DirectoryConfiguratio... | 34.277778 | 74 | 0.820097 |
e6dbd6a64683b69df4bff888e0f7db3ff36e9f22 | 55,729 | py | Python | utils/generateSwagger.py | sita1999/arangodb | 6a4f462fa209010cd064f99e63d85ce1d432c500 | [
"Apache-2.0"
] | 1 | 2018-12-08T01:58:16.000Z | 2018-12-08T01:58:16.000Z | utils/generateSwagger.py | lipper/arangodb | 66ea1fd4946668192e3f0d1060f0844f324ad7b8 | [
"Apache-2.0"
] | null | null | null | utils/generateSwagger.py | lipper/arangodb | 66ea1fd4946668192e3f0d1060f0844f324ad7b8 | [
"Apache-2.0"
] | 1 | 2018-12-05T04:56:16.000Z | 2018-12-05T04:56:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
### @brief creates swagger json files from doc headers of rest files
###
### find files in
### arangod/RestHandler/*.cpp
### js/actions/api-*.js
###
### @usage generateSwagger.py < RestXXXX.cpp... | 37.553235 | 154 | 0.476054 |
e6e192a528fe34cabfe2866855a3fbdb6b3ee642 | 769 | py | Python | backend/songwriter/migrations/0016_auto_20171124_2004.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | null | null | null | backend/songwriter/migrations/0016_auto_20171124_2004.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | 12 | 2017-09-25T20:13:29.000Z | 2020-02-12T00:12:41.000Z | backend/songwriter/migrations/0016_auto_20171124_2004.py | giliam/turbo-songwriter | 3d100b08dc19c60d7a1324120e06bd9f971eea5a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-11-24 19:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('songwriter', '0015_song_is_refrain'),
]
operations = [
migrations.AddField(... | 24.806452 | 52 | 0.579974 |
53ef92ed3a0d7ee5085204c28d46fea626dee552 | 15,236 | py | Python | tests/onegov/agency/test_forms.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/agency/test_forms.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | tests/onegov/agency/test_forms.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cgi import FieldStorage
from onegov.agency.collections import ExtendedAgencyCollection
from onegov.agency.collections import ExtendedPersonCollection
from onegov.agency.forms import AgencyMutationForm
from onegov.agency.forms import ApplyMutationForm
from onegov.agency.forms import ExtendedAgencyForm
from onegov.a... | 32.695279 | 79 | 0.640194 |
db8fd96a6b36aaef599f727b415896d1232ba3b3 | 7,366 | py | Python | Packs/RSTCloud/Integrations/RSTCloudThreatFeedAPI/RSTCloudThreatFeedAPI_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/RSTCloud/Integrations/RSTCloudThreatFeedAPI/RSTCloudThreatFeedAPI_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 61 | 2021-10-07T08:54:38.000Z | 2022-03-31T10:25:35.000Z | Packs/RSTCloud/Integrations/RSTCloudThreatFeedAPI/RSTCloudThreatFeedAPI_test.py | jrauen/content | 81a92be1cbb053a5f26a6f325eff3afc0ca840e0 | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | """RST Cloud Threat Feed API Integration for Cortex XSOAR - Unit Tests file
Test Execution
--------------
Unit tests can be checked in 3 ways:
- Using the command `lint` of demisto-sdk. The command will build a dedicated
docker instance for your integration locally and use the docker instance to
execute your ... | 38.768421 | 118 | 0.721287 |
91b309b480c62d918ed5f52443976b62a999cc35 | 92 | py | Python | 2014/06/table-obama-visits-never/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2014/06/table-obama-visits-never/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2014/06/table-obama-visits-never/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
COPY_GOOGLE_DOC_KEY = '1KAG2ahLGOzNStZapUM25Ez5oNKSs8h0auY9QRo3ZoZM'
| 23 | 68 | 0.847826 |
f417ae0f422d339d4108a431813c72cd17350496 | 1,710 | py | Python | tests/nlu/extractors/test_spacy_entity_extractors.py | YourThomasLee/rasa | 501b1b312c158e19e54c67cbca8ed3728ea60ca3 | [
"Apache-2.0"
] | 5 | 2020-08-28T06:44:31.000Z | 2021-03-14T18:46:01.000Z | tests/nlu/extractors/test_spacy_entity_extractors.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 75 | 2020-08-06T08:55:42.000Z | 2022-03-01T13:22:11.000Z | tests/nlu/extractors/test_spacy_entity_extractors.py | alfredfrancis/rasa | d8d226408f20cc2563c3aefbccef3e364a447666 | [
"Apache-2.0"
] | 3 | 2019-02-27T10:13:16.000Z | 2019-07-26T08:33:45.000Z | from rasa.nlu.config import RasaNLUModelConfig
from rasa.nlu.training_data import Message
def test_spacy_ner_extractor(component_builder, spacy_nlp):
_config = RasaNLUModelConfig({"pipeline": [{"name": "SpacyEntityExtractor"}]})
ext = component_builder.create_component(_config.for_component(0), _config)
e... | 31.666667 | 85 | 0.605848 |
f43dc6258f7e9dbcd6962376a790c90f57a1a7b4 | 1,585 | py | Python | fbtor/test/BitVecConvertTest.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | fbtor/test/BitVecConvertTest.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | fbtor/test/BitVecConvertTest.py | Aimmig/FloatingBoolector | 039ca8be5e9527613a26ce423c6e4817a0b3a2cd | [
"MIT"
] | null | null | null | from fbtor.BitVecConvert import BitVecConvStatic
from fbtor.FBoolectorTypes import FPType, RMode, WIDTH, MAN, EXP
from .test_converter import *
import pytest
"""
Test cases for the string to bitstring implementation:
"""
def test_Zero():
for t in FPType:
for r in RMode:
for sign in ["+","-"]... | 35.222222 | 76 | 0.615773 |
bea7c9bf42417c03d3ccef21208dec98b4d508c5 | 1,252 | py | Python | src/script.py | Robinson28years/MongoDB-CN-Manual | 105679c144b55e7c1b68f9c51ed3908056247d92 | [
"CC0-1.0"
] | null | null | null | src/script.py | Robinson28years/MongoDB-CN-Manual | 105679c144b55e7c1b68f9c51ed3908056247d92 | [
"CC0-1.0"
] | null | null | null | src/script.py | Robinson28years/MongoDB-CN-Manual | 105679c144b55e7c1b68f9c51ed3908056247d92 | [
"CC0-1.0"
] | null | null | null | # coding: utf-8
import os
import sys
def format_file(filename, str1, str2):
"""
文件内容的替换功能
:return:
"""
with open(filename, 'r') as f:
var_object = f.read()
if "gitalk" not in var_object:
var_object = var_object.replace(str1, str2)
# print(var_object)
f = op... | 26.083333 | 96 | 0.573482 |
beafd702ea47eb2ad6070b7392b86148df57af2b | 4,191 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_igmp_interface.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_igmp_interface.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_igmp_interface.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 30.816176 | 103 | 0.6712 |
fe279ad4e673058b45e2a626d4e05bf52c6bcf30 | 384 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/13. calculate the length of a number.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/13. calculate the length of a number.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/13. calculate the length of a number.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a function that chooses a random number 'n' from 1 and 5000 (inclusive) and then calculates the length of this number 'n'.
Do not use the built-in function 'len' to calculate the length.
Example:
n =1000
length = 4
"""
import random
def calculate_length():
n = random.randint(1,5000)
count = 0
... | 19.2 | 129 | 0.653646 |
a3f57ca9e9e97fd6161ca52aa64b655925c21bb9 | 7,173 | py | Python | src/dao/csv_.py | afranck64/benzlim | b8a3087cfe093ed9700ba92799aaeed17f1dd92f | [
"Apache-2.0"
] | null | null | null | src/dao/csv_.py | afranck64/benzlim | b8a3087cfe093ed9700ba92799aaeed17f1dd92f | [
"Apache-2.0"
] | null | null | null | src/dao/csv_.py | afranck64/benzlim | b8a3087cfe093ed9700ba92799aaeed17f1dd92f | [
"Apache-2.0"
] | null | null | null | """csv_.py - read/write/investigate csv related files"""
# -- coding: utf-8 --
import glob
import os.path
import csv
import logging
import datetime
import codecs
import pandas as pd
from ..exceptions_ import (PriceNotFoundException, StationNotFoundException, BadFormatException)
from ..config import Configuration
from... | 39.85 | 136 | 0.613411 |
4a39ae5fb263168d757d012c5071e9e106f13143 | 17,909 | py | Python | raw_code/pulson440/backprojection-alignedcopyorig.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | raw_code/pulson440/backprojection-alignedcopyorig.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | raw_code/pulson440/backprojection-alignedcopyorig.py | stevenruidigao/bwsiuassar2019 | 25e267d2c9d96c767f7f9ea168a27bcad56690b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""A script to run backprojection."""
__author__ = "Steven Gao"
__version__ = "1.0"
__maintainer__ = "Steven Gao"
__email__ = "stevenruidigao@gmail.com"
import pickle
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import argparse... | 44.549751 | 168 | 0.674689 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.