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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4b3991d6634086616a231e164657cd86332b065f | 511 | py | Python | Curso-Em-Video-Python/2Exercicios/039_Alistamento_Militar.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/039_Alistamento_Militar.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/2Exercicios/039_Alistamento_Militar.py | pedrohd21/Cursos-Feitos | b223aad83867bfa45ad161d133e33c2c200d42bd | [
"MIT"
] | null | null | null | from datetime import date
atual = date.today().year
print('ALISTAMENTO MILITAR BRASIL')
print('-' * 30)
nascimento = int(input('Qual ano voçê nasceu? '))
idade = atual - nascimento
if idade < 18:
print('Você tem {} anos. Em {} voçe vai ta capacitado a se alistar.'.format(idade, nascimento+18))
elif idade == 18:
... | 42.583333 | 104 | 0.688845 |
d9aa07a1ad9eebfbf37228d3c16a083c87428778 | 985 | py | Python | 2-resources/__DATA-Structures/Code-Challenges/cc71meanMedianMode/solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Code-Challenges/cc71meanMedianMode/solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 2-resources/__DATA-Structures/Code-Challenges/cc71meanMedianMode/solution.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | # https://youtu.be/r0xWh4QqS9Q
# https://piazza.com/class/j63w1pdyopf7kj?cid=83
from functools import reduce
from collections import Counter
def findMean(numbers):
sum = reduce(lambda x, y: x + y, numbers)
mean = sum / len(numbers)
return mean
def findMedian(numbers):
numbers.sort()
mid = len(numbers) // 2... | 22.386364 | 51 | 0.670051 |
8a5c453075a2f22762f63e4da02b6ef663164f45 | 33,393 | py | Python | edu-mail-auto-generator-main/bot.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-17T03:35:03.000Z | 2021-12-08T06:00:31.000Z | edu-mail-auto-generator-main/bot.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | null | null | null | edu-mail-auto-generator-main/bot.py | Zusyaku/Termux-And-Lali-Linux-V2 | b1a1b0841d22d4bf2cc7932b72716d55f070871e | [
"Apache-2.0"
] | 2 | 2021-11-05T18:07:48.000Z | 2022-02-24T21:25:07.000Z | import time
import re
import string
import random
import sys
import colorama
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdri... | 32.139557 | 265 | 0.575929 |
8abddef59adc2efe22b6dfd5d8ec1e2909d89aa3 | 1,198 | pyde | Python | sketches/globe03/globe03.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 4 | 2018-06-03T02:11:46.000Z | 2021-08-18T19:55:15.000Z | sketches/globe03/globe03.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | null | null | null | sketches/globe03/globe03.pyde | kantel/processingpy | 74aae222e46f68d1c8f06307aaede3cdae65c8ec | [
"MIT"
] | 3 | 2019-12-23T19:12:51.000Z | 2021-04-30T14:00:31.000Z | a = 0.0
def setup():
global globe
size(400, 400, P3D)
world = loadImage("bluemarble01.jpg")
globe = makeSphere(150, 5, world)
frameRate(30)
def draw():
global globe, a
background(0)
translate(width/2, height/2)
lights()
with pushMatrix():
rotateX(radians(-25))
r... | 26.622222 | 76 | 0.521703 |
0a2c8b7cc8fe80c6ff9e803ac21d550be63a833e | 1,177 | py | Python | movie/migrations/0001_initial.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | movie/migrations/0001_initial.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | movie/migrations/0001_initial.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-07-13 16:46
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Movie',
fields=[
('id', models.AutoField(au... | 36.78125 | 114 | 0.585387 |
0a5e5f501b6b958ec33375a0e46f1d246c94a7bd | 155 | py | Python | exercises/zh/solution_03_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/zh/solution_03_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/zh/solution_03_03.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
# 读取zh_core_web_sm流程
nlp = spacy.load("zh_core_web_sm")
# 打印流程组件的名字
print(nlp.pipe_names)
# 打印完整流程的(name, component)元组
print(nlp.pipeline)
| 14.090909 | 34 | 0.774194 |
0ae0b85854555e8b12b26d942780073890f3a8ba | 4,890 | py | Python | src/bo4e/com/tarifberechnungsparameter.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/tarifberechnungsparameter.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/tarifberechnungsparameter.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Tarifberechnungsparameter class
and corresponding marshmallow schema for de-/serialization
"""
from decimal import Decimal
from typing import List, Optional
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.com.com import COM, COMSchema
fro... | 44.862385 | 205 | 0.75501 |
7c415154b7e8446e9f7f436bba49ecf1b8b216d9 | 7,987 | py | Python | research/cv/vnet/src/data_manager.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/vnet/src/data_manager.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/vnet/src/data_manager.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., 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 agreed to... | 46.16763 | 118 | 0.607487 |
7cc5a6d0232f51b69f22604b6201246450e833ec | 362 | py | Python | src/onegov/file/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/file/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/file/__init__.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.file.collection import FileCollection, FileSetCollection
from onegov.file.integration import DepotApp
from onegov.file.models import (
File,
FileSet,
AssociatedFiles,
SearchableFile
)
__all__ = (
'AssociatedFiles',
'DepotApp',
'File',
'FileCollection',
'FileSet',
'Fi... | 19.052632 | 68 | 0.696133 |
7ccc98be66c4a3412762a48fd4b157ab1a634271 | 9,364 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/system/pam_limits.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/system/pam_limits.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/system/pam_limits.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Sebastien Rohaut <sebastien.rohaut@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version... | 29.632911 | 152 | 0.59088 |
6b092633ebd77184c0cfa8bce6dee69c1818eef4 | 1,772 | py | Python | vkapp/vk/views.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | 1 | 2017-11-23T13:33:13.000Z | 2017-11-23T13:33:13.000Z | vkapp/vk/views.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | null | null | null | vkapp/vk/views.py | ParuninPavel/lenta4_hack | 6d3340201deadf5757e37ddd7cf5580b928d7bda | [
"MIT"
] | null | null | null | from django.shortcuts import render
# def init(request, api_url, api_settings, viewer_id, group_id, is_app_user):
# return render(request, 'vk/index.html', context)
# api_url=https://api.vk.com/api.php
# &api_settings=0
# &viewer_id=123456
# &group_id=654321
# &is_app_user=0 \\
from django.views.decorators.clickj... | 32.814815 | 96 | 0.733634 |
865d260283d98621112da3fbca505d742bd932a1 | 14,446 | py | Python | model_zoo/ernie-doc/run_semantic_matching.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | model_zoo/ernie-doc/run_semantic_matching.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | model_zoo/ernie-doc/run_semantic_matching.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle 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 appli... | 42.866469 | 147 | 0.63277 |
814091f9b77f6f67cb87191426ee47c7c79ebe5c | 4,079 | py | Python | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_windows.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 3 | 2019-06-18T15:28:09.000Z | 2019-07-11T07:31:45.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_windows.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 2 | 2019-07-11T14:03:25.000Z | 2021-02-08T16:14:04.000Z | GZP_GTO_QGIS/INSTALLATION/GeoTaskOrganizer/gto_windows.py | msgis/swwat-gzp-template | 080afbe9d49fb34ed60ba45654383d9cfca01e24 | [
"MIT"
] | 1 | 2019-06-12T11:07:37.000Z | 2019-06-12T11:07:37.000Z | from builtins import str
from builtins import object
import win32gui
import re
class WindowMgr(object):
"""Encapsulates some calls to the winapi for window management"""
def __init__ (self,gtoObj,debug):
"""Constructor"""
self._handle = None
self.debug = debug
self.gtoObj =gtoOb... | 30.901515 | 99 | 0.532483 |
07f56f55f27634736297646e96b67fcd5cf9ab68 | 12,341 | py | Python | fence/blueprints/oauth2.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 31 | 2018-01-05T22:49:33.000Z | 2022-02-02T10:30:23.000Z | fence/blueprints/oauth2.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 737 | 2017-12-11T17:42:11.000Z | 2022-03-29T22:42:52.000Z | fence/blueprints/oauth2.py | scottyellis/fence | 012ba76a58853169e9ee8e3f44a0dc510f4b2543 | [
"Apache-2.0"
] | 46 | 2018-02-23T09:04:23.000Z | 2022-02-09T18:29:51.000Z | # pylint: disable=protected-access,unused-argument
"""
Define the ``OAuth2Provider`` used by fence and set its related handler
functions for storing and loading ``Grant`` models and loading ``Client``
models.
In the implementation here with JWT, a grant is a thin wrapper around the
client from which an authorization r... | 35.564841 | 87 | 0.64622 |
ed5b4d88cd296dd0bf25bdfac438410506ec0e3d | 245 | py | Python | benchmarks/fib.py | axiom-labs/cghost | ca19282dc5e122d83c101bebf106631f92d80dce | [
"MIT"
] | 4 | 2020-04-19T23:56:17.000Z | 2020-05-30T18:54:01.000Z | benchmarks/fib.py | axiom-labs/cghost | ca19282dc5e122d83c101bebf106631f92d80dce | [
"MIT"
] | 19 | 2020-05-08T22:08:51.000Z | 2020-05-30T20:59:04.000Z | benchmarks/fib.py | ghost-language/cghost | ca19282dc5e122d83c101bebf106631f92d80dce | [
"MIT"
] | 2 | 2020-04-28T05:23:33.000Z | 2020-05-26T16:35:06.000Z | from __future__ import print_function
import time
def fib(n):
if n < 2: return n
return fib(n - 1) + fib(n - 2)
start = time.process_time()
print(fib(35) == 9227465)
end = time.process_time()
print("elapsed:")
print(str(end - start)) | 17.5 | 37 | 0.665306 |
1301b07326622d1814e183b7bf9989a8e79d1cbe | 1,772 | py | Python | src/bo4e/com/zeitreihenwertkompakt.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/com/zeitreihenwertkompakt.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/com/zeitreihenwertkompakt.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | """
Contains Zeitreihenwertkompakt class
and corresponding marshmallow schema for de-/serialization
"""
from decimal import Decimal
from typing import Optional
import attr
from marshmallow import fields
from marshmallow_enum import EnumField # type:ignore[import]
from bo4e.com.com import COM, COMSchema
from bo4e.enu... | 33.433962 | 197 | 0.76298 |
b9893058efc7802eddda7f2fdca65a3fd918310b | 1,076 | py | Python | same-tree/same-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | 2 | 2021-12-05T14:29:06.000Z | 2022-01-01T05:46:13.000Z | same-tree/same-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | same-tree/same-tree.py | hyeseonko/LeetCode | 48dfc93f1638e13041d8ce1420517a886abbdc77 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
class Solution:
def isSameTree(self, p: Optional[TreeNode], q: Optional[TreeNode]) -> bool:
if not p and not q:
... | 39.851852 | 90 | 0.51487 |
b9c8642e7db30be173b2f63b0bda6ceed2d50e6b | 4,002 | py | Python | norden/norden/doctype/nvs/nvs.py | thispl/norden | 2a208056e948cae42da688e28c15024124254867 | [
"MIT"
] | null | null | null | norden/norden/doctype/nvs/nvs.py | thispl/norden | 2a208056e948cae42da688e28c15024124254867 | [
"MIT"
] | null | null | null | norden/norden/doctype/nvs/nvs.py | thispl/norden | 2a208056e948cae42da688e28c15024124254867 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Teampro and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class NVS(Document):
pass
@frappe.whitelist()
def get_nvs_header(doc):
data = '<tr><td style="bac... | 56.366197 | 212 | 0.632934 |
1644f3bade3433c08445ea631ccbaa439e7e8c91 | 2,837 | py | Python | Code/plot.py | knirschl/Proseminar-Anthropomatik | 0408e54cf220c40a6f3deae6ae8d38c5f1f4f387 | [
"MIT"
] | null | null | null | Code/plot.py | knirschl/Proseminar-Anthropomatik | 0408e54cf220c40a6f3deae6ae8d38c5f1f4f387 | [
"MIT"
] | null | null | null | Code/plot.py | knirschl/Proseminar-Anthropomatik | 0408e54cf220c40a6f3deae6ae8d38c5f1f4f387 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import os
DEFAULT_VALUE = 4
def cart2pol(x, y):
r = np.sqrt(x**2 + y**2)
phi = np.arctan2(y, x)
return (r, phi)
def pol2cart(r, phi):
x = r * np.cos(phi)
y = r * np.sin(phi)
return (x, y)
'''
Plot an 2D n... | 28.37 | 111 | 0.557631 |
e6aefaf8c8e08d12422f537b29033c7b3d25cf45 | 26,192 | py | Python | Utils/py/RL_ActionSelection/env_0/tools/naoth/CommonTypes_pb2.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2015-01-12T10:46:29.000Z | 2022-03-28T05:13:14.000Z | Utils/py/RL_ActionSelection/env_0/tools/naoth/CommonTypes_pb2.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-01-20T21:07:50.000Z | 2020-01-22T14:00:28.000Z | Utils/py/RL_ActionSelection/env_0/tools/naoth/CommonTypes_pb2.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2018-02-07T18:18:10.000Z | 2019-10-15T17:01:41.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: CommonTypes.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message a... | 33.752577 | 2,876 | 0.723885 |
e6df87fe50ce8ffd8f0096f9440651f2b9260afc | 2,366 | py | Python | travelplanner/command.py | UCL/mphy0021-2019-travel-planner-sukrire | 5f8b3479b858c46a01b68ee866560dd28d5be47a | [
"MIT"
] | null | null | null | travelplanner/command.py | UCL/mphy0021-2019-travel-planner-sukrire | 5f8b3479b858c46a01b68ee866560dd28d5be47a | [
"MIT"
] | null | null | null | travelplanner/command.py | UCL/mphy0021-2019-travel-planner-sukrire | 5f8b3479b858c46a01b68ee866560dd28d5be47a | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
from travelplanner.read_passengers import Read_passengers, Read_route
from travelplanner.Passenger import Passenger
from travelplanner.Route import Route
from travelplanner.Journey import Journey
import numpy as np
import matplotlib.pyplot as plt
import travelplanner
def process():... | 43.018182 | 79 | 0.607354 |
fc052d37ff94f3d18eb956597d7e8ea3df108603 | 5,999 | py | Python | src/visuanalytics/tests/analytics/transform/types/test_transform_compare.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_compare.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/tests/analytics/transform/types/test_transform_compare.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import unittest
from visuanalytics.tests.analytics.transform.transform_test_helper import prepare_test
class TestTransformCompare(unittest.TestCase):
def setUp(self):
self.data = {
"value1": 5,
"value2": 5,
"value3": 30,
"text1": "result"
}
def... | 30.92268 | 86 | 0.331222 |
fca1e76f827983a13f40b05e5e1e90b1176cfbcb | 421 | py | Python | day05/avgHeights.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day05/avgHeights.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day05/avgHeights.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | # 🚨 Don't change the code below 👇
student_heights = input("Input a list of student heights ").split()
for n in range(0, len(student_heights)):
student_heights[n] = int(student_heights[n])
# 🚨 Don't change the code above 👆
#Write your code below this row 👇
allHeights = 0
entryCounter = 0
for height in student_h... | 28.066667 | 67 | 0.719715 |
5d8dd2a6dfa3ccc8b4909cc0044d3ee37a0df641 | 7,325 | py | Python | src/test/tests/databases/timesliders.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/test/tests/databases/timesliders.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/test/tests/databases/timesliders.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: timesliders.py
#
# Tests: mesh - 2D, curvilinear, single domain
# plots - FilledBoundary
# databases - PDB
#
# Purpose: This test case tests out using multiple... | 29.65587 | 78 | 0.710034 |
5d69b1f00bd8c76d6fb50568daafff6e0e70b933 | 1,311 | py | Python | PINp/2014/Platonova Olga/task_9_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Platonova Olga/task_9_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | PINp/2014/Platonova Olga/task_9_21.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | # Задача 9. Вариант 21.
#Создайте игру, в которой компьютер выбирает какое-либо слово, а игрок должен его отгадать. Компьютер сообщает игроку, сколько букв в слове, и дает пять попыток узнать, есть ли какая-либо буква в слове, причем программа может отвечать только "Да" и "Нет". Вслед за тем игрок должен попробовать от... | 31.214286 | 309 | 0.64836 |
5395ebb61f6806eeee6a318809a595ce4cae0133 | 10,566 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_username.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_username.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/onyx_username.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'],
... | 36.434483 | 134 | 0.598902 |
53cfabf7a5cc02abd2fe30486782b6d0585be1ad | 15,305 | py | Python | Packs/CrowdStrikeFalconSandbox/Integrations/CrowdstrikeFalconSandboxV2/CrowdStrikeFalconSandboxV2_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/CrowdStrikeFalconSandbox/Integrations/CrowdstrikeFalconSandboxV2/CrowdStrikeFalconSandboxV2_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/CrowdStrikeFalconSandbox/Integrations/CrowdstrikeFalconSandboxV2/CrowdStrikeFalconSandboxV2_test.py | cstone112/content | 7f039931b8cfc20e89df52d895440b7321149a0d | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import io
import json
import pytest
from freezegun import freeze_time
import demistomock as demisto
from CommonServerPython import Common, ScheduledCommand, DBotScoreReliability
from CrowdStrikeFalconSandboxV2 import Client, \
validated_search_terms, get_search_term_args, split_query_to_term_args, crowdstrike_res... | 32.913978 | 122 | 0.660242 |
54f6a687d03d2d4f7f4e613f405131de0f4aac87 | 413 | py | Python | Beginner/03. Python/PasswordGenerator.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | 1 | 2021-10-04T05:41:43.000Z | 2021-10-04T05:41:43.000Z | Beginner/03. Python/PasswordGenerator.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | Beginner/03. Python/PasswordGenerator.py | ankita080208/Hacktoberfest | 2be849e89285260e7b6672f42979943ad6bbec78 | [
"MIT"
] | null | null | null | import string
import random
def main():
s1 = string.ascii_lowercase
s2 = string.ascii_uppercase
s3 = string.digits
s4 = string.punctuation
plen = int(input("Enter password length:"))
s = []
s.extend(list(s1))
s.extend(list(s2))
s.extend(list(s3))
s.extend(list(s4)... | 21.736842 | 48 | 0.590799 |
db9b183e377440fdc2d79858f088710b7181df57 | 152 | py | Python | warehouse/warehouse/doctype/building_parameters/test_building_parameters.py | vijith2121/update_warehouse | a7a15784708a87fc4684377ba3617ae1889e11f1 | [
"MIT"
] | null | null | null | warehouse/warehouse/doctype/building_parameters/test_building_parameters.py | vijith2121/update_warehouse | a7a15784708a87fc4684377ba3617ae1889e11f1 | [
"MIT"
] | null | null | null | warehouse/warehouse/doctype/building_parameters/test_building_parameters.py | vijith2121/update_warehouse | a7a15784708a87fc4684377ba3617ae1889e11f1 | [
"MIT"
] | 1 | 2021-11-30T08:35:26.000Z | 2021-11-30T08:35:26.000Z | # Copyright (c) 2021, wahni and Contributors
# See license.txt
# import frappe
import unittest
class TestBuildingParameters(unittest.TestCase):
pass
| 16.888889 | 48 | 0.789474 |
5317d0912c3f32df2986dea2f6aef4dc12e4fc6c | 76 | py | Python | code/1/goff.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | code/1/goff.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | code/1/goff.py | pwang13/AutomatedSE_Coursework | b416672d9756fcc60367143b989d29b0c905cfc3 | [
"Unlicense"
] | null | null | null | import utest
@utest.ok
def ok_goff() :
print "Goff Test"
assert (2 < 3) | 12.666667 | 19 | 0.644737 |
f431d64d3b00c8fb6f933013647116111a46f0aa | 103 | py | Python | script/importimt.py | itmattersprin/itmattersprin.github.io | 5f8d2838ee469f1ae0c88fb8625e32ef6fecca93 | [
"BSD-3-Clause"
] | 1 | 2021-02-10T14:34:49.000Z | 2021-02-10T14:34:49.000Z | script/importimt.py | itmattersprin/itmattersprin.github.io | 5f8d2838ee469f1ae0c88fb8625e32ef6fecca93 | [
"BSD-3-Clause"
] | null | null | null | script/importimt.py | itmattersprin/itmattersprin.github.io | 5f8d2838ee469f1ae0c88fb8625e32ef6fecca93 | [
"BSD-3-Clause"
] | null | null | null | from importbib import *
dest = "../_papers"
site = "imt"
importBibliography(dest, site+".bib", site)
| 17.166667 | 43 | 0.679612 |
be3f77988b0c46dd85f0cf0bc50270837ac6fcc9 | 4,882 | py | Python | examples/model_interpretation/evaluation/consistency/cal_map.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/model_interpretation/evaluation/consistency/cal_map.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/model_interpretation/evaluation/consistency/cal_map.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 PaddlePaddle 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 app... | 32.118421 | 80 | 0.600983 |
228d58e4c355045791528c795492dd036aacf659 | 3,953 | py | Python | shinrl/solvers/discrete_pi/_build_calc_params_mixin.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 34 | 2021-12-09T07:12:57.000Z | 2022-03-11T08:17:20.000Z | shinrl/solvers/discrete_pi/_build_calc_params_mixin.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | null | null | null | shinrl/solvers/discrete_pi/_build_calc_params_mixin.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 4 | 2021-12-11T07:48:01.000Z | 2022-03-01T23:50:33.000Z | """MixIns to compute new params for nn-based algorithms.
Author: Toshinori Kitamura
Affiliation: NAIST & OSX
"""
from typing import Optional
import gym
import haiku as hk
import jax
import jax.numpy as jnp
from chex import Array
from jax import value_and_grad
from optax import apply_updates
import shinrl as srl
from... | 39.929293 | 87 | 0.649127 |
a3a91acb8821c4d15f4716878184e61d43f6658c | 315 | py | Python | exercises/de/exc_02_10_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/de/exc_02_10_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/de/exc_02_10_03.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
nlp = spacy.load("en_core_web_md")
doc = nlp("This was a great restaurant. Afterwards, we went to a really nice bar.")
# Erstelle Spans für "great restaurant" und "really nice bar"
span1 = ____
span2 = ____
# Berechne die Ähnlichkeit der beiden Spans
similarity = ____.____(____)
print(similarity)
| 22.5 | 83 | 0.749206 |
a3e5c6a6a030e6487807dbcc8251a512f180eea6 | 212 | py | Python | exercise11.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | 1 | 2020-11-21T16:57:40.000Z | 2020-11-21T16:57:40.000Z | exercise11.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | null | null | null | exercise11.py | nikhadif/Advanced-Programming | e5bf4f5014c17c252bc0cb93c9d44c7c615b79c0 | [
"MIT"
] | null | null | null |
def make_word_list(a_file):
"""Create a list of words from the file"""
word_list = []
for line_str in a_file:
line_list = line_str.split()
for word in line_list:
if | 21.2 | 46 | 0.575472 |
60d2fd6b7c23d206581fbe19da12a56f13417ed6 | 885 | py | Python | src/unittest/python/grundlegend/test_addition.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | src/unittest/python/grundlegend/test_addition.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | src/unittest/python/grundlegend/test_addition.py | dlangheiter-tgm/test-mirror | 9878da44953c40abc1df0311f275c3eebc2e876b | [
"MIT"
] | null | null | null | """
Created on 27.12.2013
@author: Walter Rafeiner-Magor <wrafeiner-magor@tgm.ac.at>
"""
import unittest
from bruch.Bruch import *
class TestAddition(unittest.TestCase):
def setUp(self):
self.b = Bruch(3, 2)
self.b2 = Bruch(self.b)
self.b3 = Bruch(4, 2)
pass
def tearDown(sel... | 20.581395 | 58 | 0.550282 |
717e7241f8d3f3d3ae3ceb46de13bb7070ec7b52 | 375 | py | Python | Linkedin Learning/Learning Python/Excercise Files/Exercise Files/Ch2/variables_finished.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 331 | 2019-10-22T09:06:28.000Z | 2022-03-27T13:36:03.000Z | Linkedin Learning/Learning Python/Excercise Files/Exercise Files/Ch2/variables_finished.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 8 | 2020-04-10T07:59:06.000Z | 2022-02-06T11:36:47.000Z | Linkedin Learning/Learning Python/Excercise Files/Exercise Files/Ch2/variables_finished.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 572 | 2019-07-28T23:43:35.000Z | 2022-03-27T22:40:08.000Z | # Declare a variable and initialize it
f = 0
print (f)
# re-declaring the variable works
f = "abc"
print (f)
# ERROR: variables of different types cannot be combined
#print ("string type " + 123)
print ("string type " + str(123))
# Global vs. local variables in functions
def someFunction():
#global f
f = "def"
... | 15.625 | 56 | 0.677333 |
e80208f1a4f0d8be68d4524f3f5af500cf4e9932 | 792 | py | Python | gemtown/modelphotos/admin.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | gemtown/modelphotos/admin.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | 5 | 2020-09-04T20:13:39.000Z | 2022-02-17T22:03:33.000Z | gemtown/modelphotos/admin.py | doramong0926/gemtown | 2c39284e3c68f0cc11994bed0ee2abaad0ea06b6 | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
@admin.register(models.ModelPhoto)
class ModelPhotoAdmin(admin.ModelAdmin):
fields = [
'file',
'photo_type',
'confirm_status',
'modeler',
'contents_hash',
'blockchain_id',
'blockchain_txid',
... | 18 | 40 | 0.497475 |
1c2c24be7988d5e0d24c50cfd0f5ee10081a7573 | 665 | py | Python | day16/coffeeMachine/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day16/coffeeMachine/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day16/coffeeMachine/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | from menu import Menu, MenuItem
from coffee_maker import CoffeeMaker
from money_machine import MoneyMachine
machine = CoffeeMaker()
moneyBox = MoneyMachine()
menu = Menu()
machine_running = True
while machine_running:
choice = input(f"Our menu: {menu.get_items()} \nWhat would you like? ").lower()
if choic... | 25.576923 | 87 | 0.666165 |
98bb4631d3babecd2d077a8db557bfc61277700a | 1,192 | py | Python | production/pygsl-0.9.5/pygsl/fft.py | juhnowski/FishingRod | 457e7afb5cab424296dff95e1acf10ebf70d32a9 | [
"MIT"
] | 1 | 2019-07-29T02:53:51.000Z | 2019-07-29T02:53:51.000Z | production/pygsl-0.9.5/pygsl/fft.py | juhnowski/FishingRod | 457e7afb5cab424296dff95e1acf10ebf70d32a9 | [
"MIT"
] | 1 | 2021-09-11T14:30:32.000Z | 2021-09-11T14:30:32.000Z | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pygsl/fft.py | poojavade/Genomics_Docker | 829b5094bba18bbe03ae97daf925fee40a8476e8 | [
"Apache-2.0"
] | 2 | 2016-12-19T02:27:46.000Z | 2019-07-29T02:53:54.000Z | """
Wrapper for the FFT tranform as provided by GSL
"""
from pygsl._transform import complex_backward, complex_backward_float, \
complex_forward, complex_forward_float, \
complex_inverse, complex_inverse_float, \
complex_radix2_backward, complex_radix2_backward_float, \
complex_radix2_dif_backward, complex_radix2_dif_b... | 47.68 | 72 | 0.879195 |
c725b27f3c7fd34fae36eb1002a1a133a8712c97 | 1,185 | py | Python | official/cv/cspdarknet53/src/head.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/cspdarknet53/src/head.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/cspdarknet53/src/head.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., 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 agreed to... | 35.909091 | 99 | 0.673418 |
c7b539b2d0b355c4e958faaf2a5bfb195bc41914 | 892 | py | Python | exercises/es/exc_01_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | 2 | 2020-07-07T01:46:37.000Z | 2021-04-20T03:19:43.000Z | exercises/es/exc_01_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | exercises/es/exc_01_12_02.py | tuanducdesign/spacy-course | f8d092c5fa2997fccb3f367d174dce8667932b3d | [
"MIT"
] | null | null | null | import spacy
from spacy.matcher import Matcher
nlp = spacy.load("es_core_news_sm")
matcher = Matcher(nlp.vocab)
doc = nlp(
"descargué Fortnite en mi computadora, pero no puedo abrir el juego. "
"Ayuda? Cuando estaba descargando Minecraft, conseguí la versión de Windows "
"donde tiene una carpeta '.zip' y ... | 35.68 | 81 | 0.743274 |
c7f59e216ad3f76aef2e359555c2ac2848068388 | 685 | py | Python | haas_lib_bundles/python/libraries/soil_moisture/soil_moisture.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/soil_moisture/soil_moisture.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/soil_moisture/soil_moisture.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | from driver import GPIO
from driver import ADC
class SoilMoisture(object):
def __init__(self, DO, AO=None):
self.DO = None
self.AO = None
if not isinstance(DO, GPIO):
raise ValueError('parameter DO is not an GPIO object')
if AO is not None and not isinstance(AO, ADC):
... | 27.4 | 73 | 0.607299 |
402d41fddc17a8cb0cdad0008755d95a9043df9b | 337 | py | Python | src/onegov/feriennet/collections/notification_template.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/collections/notification_template.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/feriennet/collections/notification_template.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from onegov.core.collection import GenericCollection
class NotificationTemplateCollection(GenericCollection):
@cached_property
def model_class(self):
# XXX circular import
from onegov.feriennet.models import NotificationTemplate
return Noti... | 25.923077 | 64 | 0.789318 |
40fe87c6be127a28518fb160af9d79545f96c5f2 | 1,892 | py | Python | exercise1.py | weibk/webauto | f494f8043d05739935d1fc22b941bbc9a7ba75b7 | [
"MIT"
] | null | null | null | exercise1.py | weibk/webauto | f494f8043d05739935d1fc22b941bbc9a7ba75b7 | [
"MIT"
] | null | null | null | exercise1.py | weibk/webauto | f494f8043d05739935d1fc22b941bbc9a7ba75b7 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# encoding='utf-8'
# author:weibk
# @time:2021/10/22 10:43
from selenium import webdriver
from threading import Thread
class Test1(Thread):
def run(self):
driver1 = webdriver.Chrome()
driver1.get(r'H:\G\pythonProject\webauto\html\autotest.html')
driver1.find_element_by_... | 33.785714 | 80 | 0.625793 |
905f3878737af4ab146e491c258a5845cd855b55 | 1,068 | py | Python | src/onegov/org/models/page_move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/page_move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/models/page_move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.orm.abstract import MoveDirection
from onegov.core.utils import Bunch
from onegov.page import PageCollection
class AdjacencyListMove(object):
""" Represents a single move of an adjacency list item. """
def __init__(self, session, subject, target, direction):
self.session = session
... | 25.428571 | 63 | 0.636704 |
907d3f4582cce2baf38520a8956b16ef94bfd3c1 | 3,245 | py | Python | 7-assets/past-student-repos/Sorting-master/src/recursive_sorting/recursive_sorting.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Sorting-master/src/recursive_sorting/recursive_sorting.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/Sorting-master/src/recursive_sorting/recursive_sorting.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | import random
# TO-DO: complete the helper function below to merge 2 sorted arrays
def merge( arrA, arrB ):
elements = len( arrA ) + len( arrB )
merged_arr = [0] * elements
# Iterate through marged_arr to insert smallest item in arrA and arrB until merged_arr is full
for i in range(0, len(merged_arr))... | 32.45 | 135 | 0.638829 |
90dee715c68f91d40df2397e96dd570d20372c66 | 1,742 | py | Python | yolo/myconfig.py | wanglikang/zzuARTensorflow2 | 2e31108ca90f183ab93309aa481de1dd88f98a9b | [
"MIT"
] | null | null | null | yolo/myconfig.py | wanglikang/zzuARTensorflow2 | 2e31108ca90f183ab93309aa481de1dd88f98a9b | [
"MIT"
] | null | null | null | yolo/myconfig.py | wanglikang/zzuARTensorflow2 | 2e31108ca90f183ab93309aa481de1dd88f98a9b | [
"MIT"
] | null | null | null | #coding:utf-8
import os
import datetime
#
# path and dataset parameter
#
print("first install some necessary lib")
os.system('pip install -r requestments.txt')
listenerport = 10002
qiniuDomain = 'p7ijy2tin.bkt.clouddn.com'
'''
access_key = 'mMQxjyif6Uk8nSGIn9ZD3I19MBMEK3IUGngcX8_p'
secret_key = 'J5gFhdpQ-1O1rkCnlqYnz... | 17.247525 | 73 | 0.708955 |
90fe63823525d1e7e9f9649e85759fc3ac0ea163 | 475 | py | Python | except_handling.py | KingRedfoo/InterstellarSiri | 6fe48ee0680eaffdde8e8154e753592590aff07f | [
"Apache-2.0"
] | null | null | null | except_handling.py | KingRedfoo/InterstellarSiri | 6fe48ee0680eaffdde8e8154e753592590aff07f | [
"Apache-2.0"
] | null | null | null | except_handling.py | KingRedfoo/InterstellarSiri | 6fe48ee0680eaffdde8e8154e753592590aff07f | [
"Apache-2.0"
] | null | null | null |
try:
p =10
q = 5
p = q/0
f = open("abc.txt")
# except Exception as e: #prints exception message as type
# print(type(e))
#
#
# except Exception as e: #prints exception message
# print(e)
except ZeroDivisionError:
print("Where is my Destiny.!")
except FileNotFo... | 18.269231 | 71 | 0.616842 |
311631a9ee87357b82e6c4a3b98fdee6c2e5f98c | 3,587 | py | Python | beispielanwendungen/packaging/src/helloworld/ui/ui_helloworld.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 5 | 2017-03-11T13:27:27.000Z | 2022-01-09T10:52:05.000Z | beispielanwendungen/packaging/src/helloworld/ui/ui_helloworld.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 2 | 2021-02-14T10:59:59.000Z | 2021-10-30T21:46:32.000Z | beispielanwendungen/packaging/src/helloworld/ui/ui_helloworld.py | pbouda/pyqt-und-pyside-buch | a4ec10663ccc8aeda075c9a06b9707ded52382c8 | [
"CC-BY-4.0"
] | 1 | 2019-08-07T03:08:18.000Z | 2019-08-07T03:08:18.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/helloworld.ui'
#
# Created: Tue Aug 9 10:01:29 2011
# by: PyQt4 UI code generator 4.7.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, Ma... | 51.985507 | 130 | 0.723446 |
9ec5755c56f447cc78c8417012b7f5f7578c4d58 | 1,858 | py | Python | Utils/py/RL_ActionSelection/env_0/agent_DQN.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/RL_ActionSelection/env_0/agent_DQN.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | Utils/py/RL_ActionSelection/env_0/agent_DQN.py | tarsoly/NaoTH | dcd2b67ef6bf9953c81d3e1b26e543b5922b7d52 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from keras.models import Sequential
from keras.layers import Dense
import numpy as np
from state import State
class agent():
memory = []
# hyper parameter
epsilon = 1.0
epsilon_decay = 0.9
epsilon_min = 0.01
gamma = 0.95
learning_rate = 0.001
# initialize keras model
def __... | 26.542857 | 93 | 0.652314 |
7350bf24e87eb239b5cf53594904fd7629dcbe45 | 2,541 | py | Python | assignments/ps4-template/tests.py | tallamjr/mit-6006 | c2aa6bb48edef5800c0779ba2eebd697d44249b5 | [
"MIT"
] | 1 | 2022-02-26T13:52:31.000Z | 2022-02-26T13:52:31.000Z | assignments/ps4-template/tests.py | tallamjr/mit-6006 | c2aa6bb48edef5800c0779ba2eebd697d44249b5 | [
"MIT"
] | null | null | null | assignments/ps4-template/tests.py | tallamjr/mit-6006 | c2aa6bb48edef5800c0779ba2eebd697d44249b5 | [
"MIT"
] | null | null | null | import unittest
from tastiest_slice import tastiest_slice
tests = (
(
[(-7, 8, 5), (2, -4, 3), (7, 10, -1), (4, -3, 9), (-5, 1, 9)],
(4, 8, 26),
),
(
[(15, -1, 0), (7, 11, -7), (20, -8, 9), (-16, -4, 13), (0, -11, 18), (19, -13, -8), (16, 1, -14), (-14, -3, 10), (-7, 13, 1), (6,... | 51.857143 | 769 | 0.415978 |
b4379b8fb1dc3fdb87883f95b1eea1ccda59492d | 243 | py | Python | src/wochenbericht/models.py | nexiles/odoo.wochenbericht | 41f43327d40f849dc21e2b645810d562543fa073 | [
"MIT"
] | null | null | null | src/wochenbericht/models.py | nexiles/odoo.wochenbericht | 41f43327d40f849dc21e2b645810d562543fa073 | [
"MIT"
] | null | null | null | src/wochenbericht/models.py | nexiles/odoo.wochenbericht | 41f43327d40f849dc21e2b645810d562543fa073 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import time
import logging
import datetime
from openerp import tools, api, models, fields, osv, _
class Tagesbericht(models.Model):
_name = "wochenbericht.tagesbericht"
date = fields.Date(_("Datum"))
# EOF | 16.2 | 54 | 0.695473 |
6f59cd480c8ce76ee7a830b041e88be92958be29 | 4,484 | py | Python | _scripts/import_resources.py | marcomicera/guide | 4135647f4730ae95f6b830330a0e0e7f6e2f6e43 | [
"CC-BY-4.0"
] | 40 | 2020-03-12T20:54:40.000Z | 2021-12-21T19:35:20.000Z | _scripts/import_resources.py | marcomicera/guide | 4135647f4730ae95f6b830330a0e0e7f6e2f6e43 | [
"CC-BY-4.0"
] | 366 | 2020-03-12T19:56:21.000Z | 2021-09-28T01:06:32.000Z | _scripts/import_resources.py | marcomicera/guide | 4135647f4730ae95f6b830330a0e0e7f6e2f6e43 | [
"CC-BY-4.0"
] | 44 | 2020-03-13T02:27:47.000Z | 2020-06-04T16:53:43.000Z | #!/usr/bin/env python3
import argparse
import csv
import datetime
import io
import os
import re
import requests
import yaml
# Resource spreadsheet contents are published at this URL in the form of CSV
RESOURCES_URL="https://docs.google.com/spreadsheets/d/e/2PACX-1vQMEdZXKgYNybkqNv4X26CVNoQZHuE0zb27wuBDgdDwtiyWCICQLhyU... | 35.872 | 184 | 0.660348 |
48ce048e11cded53a323068946bf8d6948738aca | 194 | py | Python | cs/python/python_general/30-seconds-of-python-code/test/bubble_sort/bubble_sort.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | cs/python/python_general/30-seconds-of-python-code/test/bubble_sort/bubble_sort.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | 8 | 2020-03-24T17:47:23.000Z | 2022-03-12T00:33:21.000Z | cs/python/python_general/30-seconds-of-python-code/test/bubble_sort/bubble_sort.py | tobias-fyi/vela | b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82 | [
"MIT"
] | null | null | null | def bubble_sort(lst):
for passnum in range(len(lst) - 1, 0, -1):
for i in range(passnum):
if lst[i] > lst[i + 1]:
lst[i], lst[i + 1] = lst[i + 1], lst[i]
| 32.333333 | 55 | 0.463918 |
48fcfe6dbcb9299ce37829584ddd593124856857 | 2,068 | py | Python | synchroload/downloader.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 3 | 2020-07-08T08:58:46.000Z | 2020-12-01T20:23:30.000Z | synchroload/downloader.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 1 | 2020-12-30T12:49:43.000Z | 2021-01-04T11:05:48.000Z | synchroload/downloader.py | rakennus/duraphilms.github.io | bdbecdfb55f4870b5ebf572cd2a7eb4e6770ea22 | [
"MIT"
] | 2 | 2018-06-21T17:45:11.000Z | 2020-12-30T00:30:45.000Z | import youtube_dl
import urllib.error
import ffmpeg
import json
import requests
def check_availability(url):
try:
youtube_dl.YoutubeDL({"quiet": True}).extract_info(
url,
download=False
)
except urllib.error.HTTPError:
return False
except youtube_dl.utils.Ext... | 26.512821 | 98 | 0.605899 |
826ac521bd67fb134c951e620cb081c99e44d3ea | 3,495 | py | Python | garnet/lib/magma/include/magma_abi/magma.h.gen.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 3 | 2020-08-02T04:46:18.000Z | 2020-08-07T10:10:53.000Z | garnet/lib/magma/include/magma_abi/magma.h.gen.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | null | null | null | garnet/lib/magma/include/magma_abi/magma.h.gen.py | opensource-assist/fuschia | 66646c55b3d0b36aae90a4b6706b87f1a6261935 | [
"BSD-3-Clause"
] | 1 | 2020-08-07T10:11:49.000Z | 2020-08-07T10:11:49.000Z | #!/usr/bin/env python2.7
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import textwrap
import sys
def usage():
print 'Usage:'
print ' magma.h.gen.py INPUT OUTPUT'
print ' INPUT j... | 33.285714 | 100 | 0.640343 |
6fae78f92edd0d3e68d62c2820e4b929ea7711da | 112 | py | Python | src/tests/create_genesis_block.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | 2 | 2021-11-08T12:00:02.000Z | 2021-11-12T18:37:52.000Z | src/tests/create_genesis_block.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | null | null | null | src/tests/create_genesis_block.py | TimmMoetz/blockchain-lab | 02bb55cc201586dbdc8fdc252a32381f525e83ff | [
"RSA-MD"
] | 1 | 2022-03-28T13:49:37.000Z | 2022-03-28T13:49:37.000Z | from src.blockchain.blockchain import Blockchain
blockchain = Blockchain()
blockchain.create_genesis_block() | 28 | 49 | 0.830357 |
fb512327ca77e49a71a0d3621749800cb1b38b40 | 8,759 | py | Python | official/cv/vit/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | official/cv/vit/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | official/cv/vit/train.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., 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 agreed to... | 36.045267 | 110 | 0.651102 |
83df9fade56aa0f79808eae6d13ab65f51bb6eab | 4,090 | py | Python | files/meas/Experiment_03/int/unitstep.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_03/int/unitstep.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | files/meas/Experiment_03/int/unitstep.py | mimeiners/ans | 382e000e687d5ec0c80a84223087e60ed656a1dd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 21 10:10:10 2021
@author: © Vadim Grebnev, Tim Hilker, Delphino Klinker
"""
import ltspice
import matplotlib.pyplot as plt
import matplotlib.ticker as mplt
import numpy as np
import redpitaya_scpi as scpi
from time import sleep as delay
import matplotlib
matplotlib.use... | 28.802817 | 77 | 0.689487 |
5846202d18b8697fc5163cfb097f2ffd20b5ee97 | 3,002 | py | Python | Lab1/script.py | ishaanx/Labs | 9080e052a1655af28f14fcf3e777bf2a994f6543 | [
"MIT"
] | null | null | null | Lab1/script.py | ishaanx/Labs | 9080e052a1655af28f14fcf3e777bf2a994f6543 | [
"MIT"
] | null | null | null | Lab1/script.py | ishaanx/Labs | 9080e052a1655af28f14fcf3e777bf2a994f6543 | [
"MIT"
] | null | null | null | ## Lab 101
# Generate triangle
def tri(n):
for i in range(0,n):
for j in range(0,i+1):
print("* ",end="")
print("\r")
n=5
tri(n)
# Print int, float, string
def types():
x=5.555
print(int(x))
print(float(x))
print(str(x))
types()
# Print List
def list():
mylist= ["... | 25.65812 | 102 | 0.627915 |
54ad255b370fc1a79dfa3a9d672943d3f7d8b38c | 45 | py | Python | python_lessons/Textastic_Files/HelloDatabase.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/Textastic_Files/HelloDatabase.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/Textastic_Files/HelloDatabase.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | import sqlite3
import os
os.system('clear')
| 9 | 18 | 0.755556 |
49cf336641301a5749a095b18a6b00a851f8b532 | 162 | py | Python | python_lessons/Textastic_Files/HelloWorld_Python.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/Textastic_Files/HelloWorld_Python.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | python_lessons/Textastic_Files/HelloWorld_Python.py | 1986MMartin/coding-sections-markus | e13be32e5d83e69250ecfb3c76a04ee48a320607 | [
"Apache-2.0"
] | null | null | null | # import
# Hier kommt ein Kommentar für das erste Programm, geschrieben am iPad.
print("Hello World 1")
# Hier kommt nochmal ein Kommentar.
print("Hallo Welt 2") | 32.4 | 71 | 0.753086 |
3f8804ab953994c198ce1274f3581b92c6bc77b9 | 31,003 | py | Python | sam_core/sam_core/utils_perf.py | csjy309450/SAM-Backend | a23569ea372f718ca4a167e21e8046336db00561 | [
"MIT"
] | null | null | null | sam_core/sam_core/utils_perf.py | csjy309450/SAM-Backend | a23569ea372f718ca4a167e21e8046336db00561 | [
"MIT"
] | null | null | null | sam_core/sam_core/utils_perf.py | csjy309450/SAM-Backend | a23569ea372f718ca4a167e21e8046336db00561 | [
"MIT"
] | null | null | null | import json
import os
import datetime
from sam_core.res_obj import *
from sam_app.model_layer.model import *
class UtilPerfLinux:
def get_perf_info(self) -> ResPerfInfo:
host_run_time = None
host_idle_time = None
login_user_count = None
cpu_count = None
load_level = None
... | 46.342302 | 116 | 0.5364 |
3f92e96bc630aca3f28cff080e96279fe8798760 | 134 | py | Python | scripts/hello_world_tonymanou.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_tonymanou.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | null | null | null | scripts/hello_world_tonymanou.py | breezage/Hacktoberfest-1 | 6f6d52248c79c0e72fd13b599500318fce3f9ab0 | [
"MIT"
] | 1 | 2019-10-24T06:45:21.000Z | 2019-10-24T06:45:21.000Z | # LANGUAGE: Pyth
# AUTHOR: Antoine Mann
# GITHUB: https://github.com/tonymanou
# LINK: https://github.com/isaacg1/pyth
"Hello World!
| 19.142857 | 39 | 0.723881 |
b2003ac3dffdbd829f2c453abb6df9a5f0ce35cc | 1,139 | py | Python | scripts/test.py | JosiahCraw/Tiva-Helicopter-Controller-ENCE464- | 207fda18bf8e4b562e47205fbbdc9aaaf274c54f | [
"MIT"
] | null | null | null | scripts/test.py | JosiahCraw/Tiva-Helicopter-Controller-ENCE464- | 207fda18bf8e4b562e47205fbbdc9aaaf274c54f | [
"MIT"
] | null | null | null | scripts/test.py | JosiahCraw/Tiva-Helicopter-Controller-ENCE464- | 207fda18bf8e4b562e47205fbbdc9aaaf274c54f | [
"MIT"
] | null | null | null | # Quick Tester for the logic used to reset the yaw slot count
TOTAL_SLOTS = 10
MAX_ABSOLUTE_ROTATIONS = 10
def round_yaw(current_yaw, target_yaw):
if (abs(current_yaw) >= TOTAL_SLOTS * MAX_ABSOLUTE_ROTATIONS):
target_yaw = target_yaw - current_yaw
current_yaw = 0
return (target_yaw, curren... | 25.311111 | 89 | 0.586479 |
b7ca6d63906d2ad8c1ab0c773e7ea3d4eed45b37 | 6,321 | py | Python | awaiter.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | 76 | 2018-02-12T15:26:16.000Z | 2020-01-14T07:22:17.000Z | awaiter.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | 2 | 2018-02-19T16:17:39.000Z | 2018-02-19T16:19:36.000Z | awaiter.py | BigBoss1964/discord-rules | 02257a84450388ceffbad5b6bb9e28175734403f | [
"MIT"
] | 34 | 2018-02-12T15:26:20.000Z | 2021-05-04T04:30:05.000Z | import asyncio
import inspect
import string
from collections import defaultdict
from typing import Any, Collection
import discord
from discord import Message, Guild, PartialEmoji, Embed, Color, Reaction, User, Role, TextChannel
from discord.ext.commands import Bot, Context as CommandContext, Paginator
_None... | 34.353261 | 110 | 0.571903 |
4db040155117825cb90da49c7837bee5ac71986b | 1,938 | py | Python | Algorithms/Bit_Manipulation/sansa_and_xor.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Bit_Manipulation/sansa_and_xor.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | Algorithms/Bit_Manipulation/sansa_and_xor.py | byung-u/HackerRank | 4c02fefff7002b3af774b99ebf8d40f149f9d163 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from functools import reduce
for _ in range(int(input())):
N = int(input())
arr = list(map(int, input().strip().split()))
if N % 2 == 0:
print(0)
continue
res = [arr[i] for i in range(0, N, 2)]
print(reduce(lambda x, y: x ^ y, res))
"""
for _ in range(int(in... | 20.617021 | 121 | 0.539732 |
4dc98c600de1e17f4a781f4419306387123149ae | 929 | py | Python | v2/memo.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | 1 | 2021-03-31T03:41:06.000Z | 2021-03-31T03:41:06.000Z | v2/memo.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | null | null | null | v2/memo.py | timm/py | 28be3bb63433895e2bcab27ad82cb0b0cc994f37 | [
"Unlicense"
] | null | null | null | # vim: ts=2 sw=2 sts=2 et :
def mem1(f):
"Caching, simple case, no arguments."
cache = [0] # local memory
def wrapper(*l, **kw):
val = cache[0] = cache[0] or f(*l, **kw)
return val
return wrapper
def memo(f):
cache = {} # initialized at load time
def g(*lst): # called at load time
val = cache[... | 22.119048 | 53 | 0.558665 |
4284bf18df2d16171add4f8688f407d509f3cd09 | 1,270 | py | Python | programm/log.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | programm/log.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | programm/log.py | team172011/ps_cagebot | ab6f7bdbc74ad3baee3feebc4b7b0fa4f726b179 | [
"MIT"
] | null | null | null | """
Logger builder for getting a logger that can be used for debugging
(print on console) and for reales mode (disable console output)
@author: wimmer, simon-justus
"""
import logging
import os
class logger_builder:
def __init__(self, log_name = 'default Logger', log_dir='logging123'):
self.log_dir = log... | 36.285714 | 111 | 0.659843 |
67b583cbfbb018f3826d4bd2aad9bda12a7ed086 | 304 | py | Python | Python/turtle-drawing/mandala.py | DMeurer/small-projects | 3d9e714db9cd8dd8a626d9b8f0faa44325ef10e1 | [
"MIT"
] | 1 | 2021-03-25T14:23:58.000Z | 2021-03-25T14:23:58.000Z | Python/turtle-drawing/mandala.py | DMeurer/small-projects | 3d9e714db9cd8dd8a626d9b8f0faa44325ef10e1 | [
"MIT"
] | 1 | 2021-01-15T17:03:06.000Z | 2021-02-15T10:02:07.000Z | Python/turtle-drawing/mandala.py | DMeurer/small-projects | 3d9e714db9cd8dd8a626d9b8f0faa44325ef10e1 | [
"MIT"
] | null | null | null | import turtle
t=turtle.Pen()
t.hideturtle()
t.turtlesize(10)
t.speed(0)
count = 0
a = 1
x = 10
while count < 23:
count=count+1
a = 1
x = x + 5
t.penup()
t.setposition(0, 0)
t.pendown()
while a < 80:
t.forward(8)
t.right(a)
a = 1.02 * a
turtle.done() | 13.217391 | 23 | 0.523026 |
c0568a5360c6fd16a4c5b050f9e1697dfa8eda9c | 482 | py | Python | 30-Days-of-Code/Day06-LetsReview.py | sadikkuzu/HackerRank | 2b1ed2cf41f6a5404c5b9293186f301b646b5d33 | [
"Apache-2.0"
] | 5 | 2019-03-09T22:44:01.000Z | 2021-09-14T00:11:38.000Z | 30-Days-of-Code/Day06-LetsReview.py | jguerra7/HackerRank-4 | 7e1663d0050ffbb0fd885b8affdada9ea13b0e80 | [
"Apache-2.0"
] | 4 | 2018-08-16T09:39:47.000Z | 2018-09-14T17:37:07.000Z | 30-Days-of-Code/Day06-LetsReview.py | jguerra7/HackerRank-4 | 7e1663d0050ffbb0fd885b8affdada9ea13b0e80 | [
"Apache-2.0"
] | 1 | 2020-06-01T23:38:35.000Z | 2020-06-01T23:38:35.000Z | # https://www.hackerrank.com/challenges/30-review-loop
# Enter your code here. Read input from STDIN. Print output to STDOUT
def gezgin(s):
l = list(s)
l.reverse()
k, m = list(), list()
while(len(l)>0):
try:
k.append(l.pop())
m.append(l.pop())
except:
... | 22.952381 | 69 | 0.526971 |
223af60b7d17a0cec1f80de72df87ff76493c83b | 3,932 | py | Python | transonic/test_typing.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 88 | 2019-01-08T16:39:08.000Z | 2022-02-06T14:19:23.000Z | transonic/test_typing.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 13 | 2019-06-20T15:53:10.000Z | 2021-02-09T11:03:29.000Z | transonic/test_typing.py | fluiddyn/transonic | a460e9f6d1139f79b668cb3306d1e8a7e190b72d | [
"BSD-3-Clause"
] | 1 | 2019-11-05T03:03:14.000Z | 2019-11-05T03:03:14.000Z | import numpy as np
from transonic.typing import (
Array,
NDim,
str2type,
UnionMeta,
List,
ListMeta,
Dict,
DictMeta,
Set,
SetMeta,
typeof,
str2shape,
MemLayout,
Optional,
const,
)
from transonic.backends.typing import base_type_formatter
def compare_array_t... | 23.266272 | 82 | 0.619532 |
97f2c1e4039d208400d97e97ea51a6e49366fbb1 | 1,105 | py | Python | HITCON/2020/Quals/revenge_of_pwn/exploit.py | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | HITCON/2020/Quals/revenge_of_pwn/exploit.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | HITCON/2020/Quals/revenge_of_pwn/exploit.py | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | #!/usr/bin/env python3
from pwn import *
import os
host, port = '127.0.0.1', 1337
context.arch = 'amd64'
context.timeout = 2
log.info('Version of pwntools: ' + pwnlib.__version__)
r = remote(host, port)
r.recvuntil('stack address @ 0x')
stk = int(r.recvline(), 16)
log.info('stk @ ' + hex(stk))
l = listen(31337)
s... | 25.113636 | 119 | 0.651584 |
45295ca7b51cf9de0e1736fda2407cc538026756 | 495 | py | Python | hardware/seat_cam/communication.py | BlueHC/TTHack-2018--Easy-Rider-1 | 8cd8f66de88ff80751a1083350c38985ac26914d | [
"Apache-2.0"
] | null | null | null | hardware/seat_cam/communication.py | BlueHC/TTHack-2018--Easy-Rider-1 | 8cd8f66de88ff80751a1083350c38985ac26914d | [
"Apache-2.0"
] | null | null | null | hardware/seat_cam/communication.py | BlueHC/TTHack-2018--Easy-Rider-1 | 8cd8f66de88ff80751a1083350c38985ac26914d | [
"Apache-2.0"
] | null | null | null | import requests
url = "http://easyriderbackend.eu-gb.mybluemix.net/occupancy"
querystring = {"mediumID":"1"}
headers = {
'content-type': "application/json",
'cache-control': "no-cache"
}
def getPayload(val):
return "{\n\t\"latitude\": 123432.222,\n\t\"longitude\": 42332.21,\n\t\"amount\": " + str(val) +... | 27.5 | 109 | 0.670707 |
e1951fe6fa8690030231089eef11d51e8b502dc4 | 1,481 | py | Python | Packs/LINENotify/Integrations/LINENotify/LINENotify.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/LINENotify/Integrations/LINENotify/LINENotify.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/LINENotify/Integrations/LINENotify/LINENotify.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
import requests
''' MAIN FUNCTION '''
def main() -> None:
api_token = demisto.params().get('apitoken')
try:
if demisto.command() == 'line-send-message':
# This is for sending LINE notification to s... | 32.911111 | 103 | 0.579338 |
beff155279165122788b438616e9423cc050fd3b | 328 | py | Python | P8702N/userAccount.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2017-12-12T13:58:08.000Z | 2017-12-12T13:58:08.000Z | P8702N/userAccount.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | null | null | null | P8702N/userAccount.py | wittrup/crap | a77474588fd54a5a998e24df7b1e6e2ab473ded1 | [
"MIT"
] | 1 | 2019-11-03T10:16:35.000Z | 2019-11-03T10:16:35.000Z | import impat
impat.addfolder('python')
from random import randrange
from FunCom import find_between
from session import login, host, usr, pwd
import requests
print(login)
print(login.cookies)
if login.status_code == requests.codes.ok:
print('=~=~=~=~=~=~=~=~=~=~=~= =~=~=~=~=~=~=~=~=~... | 25.230769 | 90 | 0.594512 |
83057ccb9a36c7bd06b9229170bc6a518953d331 | 1,247 | py | Python | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex01_tower.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex01_tower.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | Python/zzz_training_challenge/Python_Challenge/solutions/ch07_recursion_advanced/solutions/ex01_tower.py | Kreijeck/learning | eaffee08e61f2a34e01eb8f9f04519aac633f48c | [
"MIT"
] | null | null | null | from ch05_datastructures.solutions.ex02_stack import Stack
class Tower:
def __init__(self, name):
self.name = name
self.__values = Stack()
def __str__(self):
return "Tower [" + self.name + "]"
def push(self, item):
self.__values.push(item)
def pop(self):
retu... | 26.531915 | 90 | 0.565357 |
c558364eaa8a028f99295762f0346c9a700d116a | 1,415 | py | Python | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Notify/Notify.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 63 | 2018-02-04T03:31:22.000Z | 2022-03-07T08:27:39.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Notify/Notify.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 3 | 2017-09-17T02:33:18.000Z | 2020-12-18T23:20:59.000Z | mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Notify/Notify.py | smthkissinger/docker-images | 35e868295d04fa780325ada4168381f1e80e8fe4 | [
"BSD-3-Clause"
] | 40 | 2018-01-22T16:31:16.000Z | 2022-03-08T04:40:42.000Z | import logging
from mongodb_consistent_backup.Errors import Error, NotifyError
from mongodb_consistent_backup.Notify.Nsca import Nsca # NOQA
from mongodb_consistent_backup.Pipeline import Stage
class Notify(Stage):
def __init__(self, manager, config, timer, base_dir, backup_dir):
super(Notify, self).__i... | 36.282051 | 112 | 0.583746 |
3debbb06947ea28244cc5fdb3f64eada79b0f506 | 931 | py | Python | agents/base_agent.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 2 | 2022-02-24T08:21:49.000Z | 2022-03-10T08:57:35.000Z | agents/base_agent.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | 1 | 2022-02-24T08:40:21.000Z | 2022-02-24T12:01:58.000Z | agents/base_agent.py | yerfor/Soft-DRGN | 0c96d1ea295077b949229261c37d8dde25001a03 | [
"MIT"
] | null | null | null | import torch.nn as nn
class BaseAgent(nn.Module):
def __init__(self):
self.learned_model = None
self.target_model = None
def action(self, sample, epsilon, action_mode):
raise NotImplementedError
def cal_q_loss(self, sample, losses, log_vars):
raise NotImplementedError
... | 25.162162 | 51 | 0.691729 |
b19f2b80fbbac0a50bd46172488d8edbe7328430 | 1,522 | py | Python | GFPGAN/main.py | FabianBell/24h-dezember-2021 | 139c5996479db0cdcb96189a2c89ee34c45a9d37 | [
"Apache-2.0"
] | null | null | null | GFPGAN/main.py | FabianBell/24h-dezember-2021 | 139c5996479db0cdcb96189a2c89ee34c45a9d37 | [
"Apache-2.0"
] | 5 | 2021-12-17T09:52:50.000Z | 2021-12-17T10:50:05.000Z | GFPGAN/main.py | FabianBell/24h-dezember-2021 | 139c5996479db0cdcb96189a2c89ee34c45a9d37 | [
"Apache-2.0"
] | null | null | null | import cv2
import numpy as np
from gfpgan import GFPGANer
import pika
import os
import json
import base64
MODEL_PATH = "models/GFPGANCleanv1-NoCE-C2.pth"
INPUT_NAME = "FACE_RESTORE_TASK"
OUTPUT_NAME = "FACE_RESTORE_RESPONSE"
# init model
model = GFPGANer(
model_path=MODEL_PATH,
upscale=2,
arch="clean",
... | 27.672727 | 98 | 0.726675 |
493ef41917b75c564d31e9ec519ea1e9e55c5d80 | 2,146 | py | Python | src/visuanalytics/server/db/db.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 3 | 2020-08-24T19:02:09.000Z | 2021-05-27T20:22:41.000Z | src/visuanalytics/server/db/db.py | mxsph/Data-Analytics | c82ff54b78f50b6660d7640bfee96ea68bef598f | [
"MIT"
] | 342 | 2020-08-13T10:24:23.000Z | 2021-08-12T14:01:52.000Z | src/visuanalytics/server/db/db.py | visuanalytics/visuanalytics | f9cce7bc9e3227568939648ddd1dd6df02eac752 | [
"MIT"
] | 8 | 2020-09-01T07:11:18.000Z | 2021-04-09T09:02:11.000Z | import logging
import os
import sqlite3
import flask
from visuanalytics.util import resources
logger = logging.getLogger(__name__)
DATABASE_LOCATION = ""
def open_con():
""" Öffnet DB-Verbindung außerhalb des Flask-Kontexts.
Dieese Methode wird u.a. für den DB-Scheduler benötigt, welcher unabhängig vom F... | 26.493827 | 112 | 0.655172 |
77086bf8b3390e8250512d45c718fbbe18ccaf61 | 315 | py | Python | python/image_processing/opening.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/image_processing/opening.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/image_processing/opening.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z |
import cv2
import numpy as np
img = cv2.imread('opening.png',0)
kernel = np.ones((5,5),np.uint8)
opening = cv2.morphologyEx(img, cv2.MORPH_OPEN, kernel)
cv2.imshow('image cv2',img)
cv2.imshow('image erosion',opening)
cv2.waitKey(0)
# to save the image
# cv2.imwrite('image1.png',img)
cv2.destroyAllWindows()
| 16.578947 | 55 | 0.720635 |
6558e37fb832289250b72956821ba09ceb5663f7 | 4,047 | py | Python | examples/v1beta1/trial-images/enas-cnn-cifar10/RunTrial.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 17 | 2018-04-04T08:44:06.000Z | 2018-04-19T18:02:05.000Z | examples/v1beta1/trial-images/enas-cnn-cifar10/RunTrial.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 58 | 2018-04-03T19:05:50.000Z | 2018-04-19T16:14:04.000Z | examples/v1beta1/trial-images/enas-cnn-cifar10/RunTrial.py | d-gol/katib | 2c8758b26ffd543e08b70464f8ac7b286f3ca2ea | [
"Apache-2.0"
] | 10 | 2018-04-04T02:06:20.000Z | 2018-04-19T08:53:04.000Z | # Copyright 2022 The Kubeflow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 41.295918 | 91 | 0.661478 |
65b7ac10f2593b81d10e7ceec3e26897a323dc76 | 1,219 | py | Python | shinrl/solvers/continuous_ddpg/_build_net_act_mixin.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 34 | 2021-12-09T07:12:57.000Z | 2022-03-11T08:17:20.000Z | shinrl/solvers/continuous_ddpg/_build_net_act_mixin.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | null | null | null | shinrl/solvers/continuous_ddpg/_build_net_act_mixin.py | omron-sinicx/ShinRL | 09f4ae274a33d1fc1d9d542f816aef40014af6b5 | [
"MIT"
] | 4 | 2021-12-11T07:48:01.000Z | 2022-03-01T23:50:33.000Z | """MixIn building act_functions for GymExplore and GymEval MixIns.
Author: Toshinori Kitamura
Affiliation: NAIST & OSX
"""
from typing import Callable, Optional
import gym
import shinrl as srl
from .config import DdpgConfig
class BuildNetActMixIn:
def initialize(self, env: gym.Env, config: Optional[DdpgConfig]... | 29.731707 | 84 | 0.631665 |
02b472e054a4436edd129817288e04d1f6a12fa2 | 2,001 | py | Python | scripts/upstream_changes.py | rendiputra/website | 4b93c0608828e685881be1662e766d696f0b097b | [
"CC-BY-4.0"
] | 3,157 | 2017-10-18T13:28:53.000Z | 2022-03-31T06:41:57.000Z | scripts/upstream_changes.py | rendiputra/website | 4b93c0608828e685881be1662e766d696f0b097b | [
"CC-BY-4.0"
] | 27,074 | 2017-10-18T09:53:11.000Z | 2022-03-31T23:57:19.000Z | scripts/upstream_changes.py | rendiputra/website | 4b93c0608828e685881be1662e766d696f0b097b | [
"CC-BY-4.0"
] | 11,539 | 2017-10-18T15:54:11.000Z | 2022-03-31T12:51:54.000Z | #!/usr/bin/env python
import re
from subprocess import check_output
import click
def last_commit(path, git):
"""
Find the hash of the last commit that touched a file.
"""
cmd = [git, "log", "-n", "1", "--pretty=format:%H", "--", path]
try:
return check_output(cmd)
except Exception as... | 25.329114 | 92 | 0.616192 |
b21cbcaa26ca31e519292685c2cc61f9a9487fe9 | 322 | py | Python | pacman-arch/test/pacman/tests/sync003.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/sync003.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/sync003.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "Install a package from a sync db, with a filesystem conflict"
sp = pmpkg("dummy")
sp.files = ["bin/dummy",
"usr/man/man1/dummy.1"]
self.addpkg2db("sync", sp)
self.filesystem = ["bin/dummy"]
self.args = "-S %s" % sp.name
self.addrule("PACMAN_RETCODE=1")
self.addrule("!PKG_EXIST=dummy"... | 23 | 81 | 0.667702 |
0c221875dd13afd534b86ec96cd3820a2eaca0c7 | 2,850 | py | Python | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/08_chapter_07_repetition_questions.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | null | null | null | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/08_chapter_07_repetition_questions.py | Apop85/Scripts | e71e1c18539e67543e3509c424c7f2d6528da654 | [
"MIT"
] | 6 | 2020-12-24T15:15:09.000Z | 2022-01-13T01:58:35.000Z | Python/Buch_Python3_Das_umfassende_Praxisbuch/Kapitel_07_Sequenzen_Mengen_und_Generatoren/08_chapter_07_repetition_questions.py | Apop85/Scripts | 1d8dad316c55e1f1343526eac9e4b3d0909e4873 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: 08_chapter_07_repetition_questions.py
# Project: Kapitel_07_Sequenzen_Mengen_und_Generatoren
# Created Date: Tuesday 05.03.2019, 16:17
# Author: Apop85
# -----
# Last Modified: Tuesday 05.03.2019, 16:43
# -----
# Copyright (c) 2019 Apop85
# This software is publ... | 50 | 148 | 0.683509 |
0c230992f1ad2f555331157b7145688f14ef7b19 | 1,101 | py | Python | Aufgabe4-Implementierung/DrawRectangles.py | laugengebaeck/BwInf-37-R1 | e048aec81cbeacdd7cc858824c99dae9684efb2b | [
"Apache-2.0"
] | 1 | 2020-06-16T10:22:16.000Z | 2020-06-16T10:22:16.000Z | Aufgabe4-Implementierung/DrawRectangles.py | laugengebaeck/BwInf-37-R1 | e048aec81cbeacdd7cc858824c99dae9684efb2b | [
"Apache-2.0"
] | null | null | null | Aufgabe4-Implementierung/DrawRectangles.py | laugengebaeck/BwInf-37-R1 | e048aec81cbeacdd7cc858824c99dae9684efb2b | [
"Apache-2.0"
] | null | null | null | import turtle
import time
f = open ("coordinates.txt", "r")
coordinates = f.readlines()
number = ""
enclose = []
for a in coordinates[0]:
if a != "," and a != "\n":
number = number + a
elif a == ",":
enclose.append(int(number)*20)
number = ""
turtle.forward(enclose[0])
... | 22.469388 | 51 | 0.534968 |
ac61e37f4098b532dcb9d24993da028ccecb5fc3 | 276 | py | Python | backups/sandbox-backup/python/sandbox_start.py | roskenet/Playground | 3cce70eeb38646b0f2ffbd071c3aaec7b8f5b9cb | [
"MIT"
] | null | null | null | backups/sandbox-backup/python/sandbox_start.py | roskenet/Playground | 3cce70eeb38646b0f2ffbd071c3aaec7b8f5b9cb | [
"MIT"
] | null | null | null | backups/sandbox-backup/python/sandbox_start.py | roskenet/Playground | 3cce70eeb38646b0f2ffbd071c3aaec7b8f5b9cb | [
"MIT"
] | 1 | 2020-10-02T04:57:25.000Z | 2020-10-02T04:57:25.000Z | #!/usr/bin/env python3
import subprocess
import io
process = subprocess.Popen(['ls', '-la'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdout,stderr = process.communicate()
output = stdout.decode("utf-8")
for i in output.split("\n"):
print(i)
| 17.25 | 41 | 0.666667 |
5a5637e816c2d8e210de113d895ea179b8cd8ee3 | 6,310 | py | Python | InterviewBit_problems/Sorting/Max Sum Contiguous SubArray/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | InterviewBit_problems/Sorting/Max Sum Contiguous SubArray/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | InterviewBit_problems/Sorting/Max Sum Contiguous SubArray/solution.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | '''
This program returns an integer representing the maximum possible sum of the contiguous subarray using Kadane's Algorithm
- Creating a function maxSubArray() which will take one argument as a List A
- Initializing two variables max_so_far and curr_max which will store the first element in the List A
- Traversing t... | 286.818182 | 5,350 | 0.518859 |
cedcf88e4e5e29c1bd7e7732bb42f4a9d611eb55 | 5,630 | py | Python | verto/processors/GenericContainerBlockProcessor.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 4 | 2017-04-10T06:09:54.000Z | 2019-05-04T02:07:40.000Z | verto/processors/GenericContainerBlockProcessor.py | uccser/verto | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 268 | 2017-04-03T20:40:46.000Z | 2022-02-04T20:10:08.000Z | verto/processors/GenericContainerBlockProcessor.py | uccser/kordac | d36aa88b208f1700fafc033679bd1e9775496d25 | [
"MIT"
] | 1 | 2019-01-07T15:46:31.000Z | 2019-01-07T15:46:31.000Z | from markdown.blockprocessors import BlockProcessor
from verto.errors.TagNotMatchedError import TagNotMatchedError
from verto.errors.ArgumentValueError import ArgumentValueError
from verto.processors.utils import etree, parse_arguments, process_parameters, blocks_to_string
from verto.utils.HtmlParser import HtmlParser
... | 40.797101 | 114 | 0.638188 |
cc168d1c4516aba78a4cd92281cd0fa4db4f638f | 416 | py | Python | BeautifulData/Admin/admin_setup.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | BeautifulData/Admin/admin_setup.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | BeautifulData/Admin/admin_setup.py | zhangyafeii/Flask | 9c9a5ea282f77aabcda838796dad2411af9b519f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@Datetime: 2019/1/2
@Author: Zhang Yafei
"""
import settings
from importlib import import_module
def admin_auto_discover():
for app_name in settings.INSTALLED_APPS:
try:
__import__('{}.admin'.format(app_name))
except:
try:
import... | 21.894737 | 58 | 0.576923 |
4f4f1bdaa96d91a91b3307c1c06b58139a48f973 | 3,826 | py | Python | tests/test_routines.py | keawe-software/Umbrella | eee5aded0bb8ef09583dcf320802e0ae0e41041f | [
"Apache-2.0"
] | null | null | null | tests/test_routines.py | keawe-software/Umbrella | eee5aded0bb8ef09583dcf320802e0ae0e41041f | [
"Apache-2.0"
] | null | null | null | tests/test_routines.py | keawe-software/Umbrella | eee5aded0bb8ef09583dcf320802e0ae0e41041f | [
"Apache-2.0"
] | 1 | 2021-06-04T17:30:40.000Z | 2021-06-04T17:30:40.000Z | #!/usr/bin/python
import os
import requests
import sqlite3
import urlparse
import json
CRED = '\033[91m'
CYEL = '\033[33m'
CEND = '\033[0m'
error_count = 0
# next three lines allow unicode handling
import sys
from multiprocessing import Condition
reload(sys)
sys.setdefaultencoding('utf8')
def abortX():
global er... | 29.430769 | 130 | 0.631992 |
4f85159e61c0af274a85a864951110abb13c9015 | 1,252 | py | Python | Packs/CortexXDR/Scripts/EntryWidgetPieAlertsXDR/EntryWidgetPieAlertsXDR.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/CortexXDR/Scripts/EntryWidgetPieAlertsXDR/EntryWidgetPieAlertsXDR.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/CortexXDR/Scripts/EntryWidgetPieAlertsXDR/EntryWidgetPieAlertsXDR.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import demistomock as demisto
incident = demisto.incidents()
data = {
"Type": 17,
"ContentsFormat": "pie",
"Contents": {
"stats": [
{
"data": [
int(incident[0].get('CustomFields', {}).get('xdrhighseverityalertcount', 0))
],
... | 28.454545 | 98 | 0.388179 |
4f8ed0e6691c3d7d350704e515ce76c39385c889 | 1,153 | py | Python | main/assets/models/create_models_list.py | Lyniat/dungeon-hop | e8d19b2c933feb6665935f37f73785626698ea09 | [
"MIT"
] | null | null | null | main/assets/models/create_models_list.py | Lyniat/dungeon-hop | e8d19b2c933feb6665935f37f73785626698ea09 | [
"MIT"
] | null | null | null | main/assets/models/create_models_list.py | Lyniat/dungeon-hop | e8d19b2c933feb6665935f37f73785626698ea09 | [
"MIT"
] | null | null | null | import os
import json
files = {}
players = []
enemies = []
obstacles = []
path = os.getcwd()+"/json"
#player models
id = 0
print("\nadding files for player:")
for file in os.listdir(path+"/players"):
if file.endswith(".js"):
name = file.split(".")[0]
players.append({"name":name,"id":id})
i... | 20.589286 | 47 | 0.606245 |
8c3154123556ccdc7d8d96fcfd8f4ab8907be858 | 7,109 | py | Python | 5_DeepLearning-Visualization/DogsCats_Dataset_class.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 5_DeepLearning-Visualization/DogsCats_Dataset_class.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | 5_DeepLearning-Visualization/DogsCats_Dataset_class.py | felixdittrich92/DeepLearning-tensorflow-keras | 2880d8ed28ba87f28851affa92b6fa99d2e47be9 | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
import cv2
from skimage import transform
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.preprocessing.image impor... | 40.163842 | 100 | 0.64341 |
8c3432369910cbb98badd2404a8465c2ccfcc272 | 9,463 | py | Python | Utils/update_branch_from_version.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Utils/update_branch_from_version.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Utils/update_branch_from_version.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import subprocess
import argparse
import os
import click
import ujson
from ruamel.yaml import YAML
from ruamel.yaml.scalarstring import FoldedScalarString
from pkg_resources import parse_version
import shutil
ryaml = YAML()
ryaml.preserve_quotes = True # type: ignore[assignment]
# make sure long lines will not break... | 36.821012 | 125 | 0.670718 |
4fec7a99a0ba602c990c251a20b71507917d5deb | 857 | py | Python | sso-db/ssodb/common/models/city_model.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | sso-db/ssodb/common/models/city_model.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | sso-db/ssodb/common/models/city_model.py | faical-yannick-congo/sso-backend | e962006b0fecd68e4da94e54b4dc63547a5a2c21 | [
"MIT"
] | null | null | null | import datetime
from ..core import db
import json
from bson import ObjectId
from ..models import Country
class City(db.Document):
created_at = db.StringField(default=str(datetime.datetime.utcnow()))
updated_at = db.StringField(default=str(datetime.datetime.utcnow()))
name = db.StringField(required=True)
... | 32.961538 | 81 | 0.665111 |
8c724475d6fbaec2c11778116b5afd4db2577711 | 3,764 | py | Python | Generator/xml.py | Design-Computation-RWTH/ILC_Demonstrator | 60046366383de053026a0d03b213f6af3610f608 | [
"MIT"
] | 1 | 2021-06-08T10:04:35.000Z | 2021-06-08T10:04:35.000Z | mvdXMLGen/ILC_Demonstrator-master/Generator/xml.py | BIMInstitut/MRL-Datenbank | 81130071d3b76eba010e7649a2cbaf0a1b7dcfc4 | [
"MIT"
] | null | null | null | mvdXMLGen/ILC_Demonstrator-master/Generator/xml.py | BIMInstitut/MRL-Datenbank | 81130071d3b76eba010e7649a2cbaf0a1b7dcfc4 | [
"MIT"
] | 1 | 2021-05-04T09:38:20.000Z | 2021-05-04T09:38:20.000Z | # -*- coding: utf-8 -*-
from string import Formatter
#formatter for getting placeholder and set other value
class FormatXML:
def __init__(self, template_string):
#self.template = open(template_file).read()
self.template = template_string
self.required_keys = [ele[1] for ele in Formatter().... | 42.292135 | 122 | 0.722104 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.