code stringlengths 2k 1.04M | repo_path stringlengths 5 517 | parsed_code stringlengths 0 1.04M | quality_prob float64 0.02 0.95 | learning_prob float64 0.02 0.93 |
|---|---|---|---|---|
"""globals variables demo"""
import globalsContainer
import globalsContainerSimple
import modul2
def f1():
gc = globalsContainer
print("m1.f1:",gc.varA1, gc.myglobals.varC1, globalsContainerSimple.testvar)
print("m1.f1 change values")
gc.varA1 = 111
gc.myglobals.varC1 =112
globalsContainerSimple.testvar =... | globalvars/modul1.py | """globals variables demo"""
import globalsContainer
import globalsContainerSimple
import modul2
def f1():
gc = globalsContainer
print("m1.f1:",gc.varA1, gc.myglobals.varC1, globalsContainerSimple.testvar)
print("m1.f1 change values")
gc.varA1 = 111
gc.myglobals.varC1 =112
globalsContainerSimple.testvar =... | 0.162413 | 0.127898 |
import tensorflow as tf
from xcenternet.model.evaluation.mean_average_precision import MAP
class MAPValidationCallback(tf.keras.callbacks.Callback):
"""
Callback that allows us to calculate Mean Average Precision and write it to TensorBoard.
Tp be used on validation dataset and it is performed only when... | xcenternet/model/callbacks.py | import tensorflow as tf
from xcenternet.model.evaluation.mean_average_precision import MAP
class MAPValidationCallback(tf.keras.callbacks.Callback):
"""
Callback that allows us to calculate Mean Average Precision and write it to TensorBoard.
Tp be used on validation dataset and it is performed only when... | 0.889337 | 0.401805 |
def lastrow_to_friendsoftracking(data):
# data - dataframe in format of '../Last-Row-master/datasets/positional_data/liverpool_2019.csv'
import numpy as np
# Create a consistent player variable across all matches -
# **not consistent player to player each match, but all players num... | bokeh-app/lastrow_to_friendsoftracking.py | def lastrow_to_friendsoftracking(data):
# data - dataframe in format of '../Last-Row-master/datasets/positional_data/liverpool_2019.csv'
import numpy as np
# Create a consistent player variable across all matches -
# **not consistent player to player each match, but all players num... | 0.461988 | 0.65484 |
from __future__ import division
#!/usr/bin/env python
from scitbx import matrix
from rstbx.bpcx import sensor
class detector:
'''An abstract class definition for X-ray detectors which are assumed to
be composed of one or more flat rectangular sensor areas. Will initially
assume that sensor areas to not sh... | rstbx/bpcx/detector_model/detector.py | from __future__ import division
#!/usr/bin/env python
from scitbx import matrix
from rstbx.bpcx import sensor
class detector:
'''An abstract class definition for X-ray detectors which are assumed to
be composed of one or more flat rectangular sensor areas. Will initially
assume that sensor areas to not sh... | 0.742328 | 0.658555 |
cmaps = {
"Accent": [
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97... | vedo/cmaps.py | cmaps = {
"Accent": [
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97f",
"#7fc97... | 0.222785 | 0.235636 |
from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm, ContactForm
from gpsschool.models import Teacher, Student
from .models import ContactUs
def register(requ... | users/views.py | from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from .forms import UserRegisterForm, UserUpdateForm, ProfileUpdateForm, ContactForm
from gpsschool.models import Teacher, Student
from .models import ContactUs
def register(requ... | 0.294012 | 0.067731 |
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
import numpy as np
# ----------------------------------------------------------------------
# Methods
# --------------------------------------------------------... | SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Geometry/Three_Dimensional/estimate_naca_4_series_internal_volume.py |
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
import numpy as np
# ----------------------------------------------------------------------
# Methods
# --------------------------------------------------------... | 0.691393 | 0.490053 |
import os
import argparse
import subprocess
import time
import shlex
GRID_JOBS_OPTION="--grid-jobs"
STARTUP_TIME = 5 * 60
MAX_SLEEP = 40 * 60
def process_ps_stdout(stdout):
""" Process the stdout of the ps command """
return [i.split()[0] for i in filter(lambda x: x, stdout.decode("utf-8").split("\n")[1:])]... | biobakery_workflows/scripts/burst_workflow.py |
import os
import argparse
import subprocess
import time
import shlex
GRID_JOBS_OPTION="--grid-jobs"
STARTUP_TIME = 5 * 60
MAX_SLEEP = 40 * 60
def process_ps_stdout(stdout):
""" Process the stdout of the ps command """
return [i.split()[0] for i in filter(lambda x: x, stdout.decode("utf-8").split("\n")[1:])]... | 0.40251 | 0.147647 |
from __future__ import unicode_literals
import json
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.models import Session
from django.db import models
from django.db.models import Count
from django.db.models import When, Case
from django.utils.translation import ugettext_lazy a... | djadmin/models.py | from __future__ import unicode_literals
import json
from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.models import Session
from django.db import models
from django.db.models import Count
from django.db.models import When, Case
from django.utils.translation import ugettext_lazy a... | 0.579162 | 0.096068 |
from __future__ import print_function
import os
import re
import sys
import argparse
from cfutils.execute import *
from cfutils.formatting import print_c
from autolibs.ansible.deploy import DeployConfig
from autolibs.ansible.repository import AnsibleRepo
def list_actions():
""" Lists the actions available. """... | autolibs/bin/ansible/supportvault.py |
from __future__ import print_function
import os
import re
import sys
import argparse
from cfutils.execute import *
from cfutils.formatting import print_c
from autolibs.ansible.deploy import DeployConfig
from autolibs.ansible.repository import AnsibleRepo
def list_actions():
""" Lists the actions available. """... | 0.480966 | 0.194119 |