code
stringlengths
3
6.57k
bind_layers(BTLEJack_Hdr, BTLEJack_Recover_Connection_AA_Response,packet_type=0x2, opcode=0x4)
bind_layers(BTLEJack_Hdr, BTLEJack_Recover_Connection_AA_Chm_Response,packet_type=0x2, opcode=0x5)
bind_layers(BTLEJack_Hdr, BTLEJack_Jam_Advertisements_Command,packet_type=0x1,opcode=0x5)
bind_layers(BTLEJack_Hdr, BTLEJack_Recover_Response,packet_type=0x2, opcode=0x4)
bind_layers(BTLEJack_Hdr, BTLEJack_Version_Response,packet_type=0x2, opcode=0x1)
bind_layers(BTLEJack_Hdr, BTLEJack_Reset_Response,packet_type=0x2, opcode=0x2)
bind_layers(BTLEJack_Hdr, BTLEJack_Scan_Connections_Response,packet_type=0x2, opcode=0x3)
bind_layers(BTLEJack_Hdr, BTLEJack_Collaborative_Channel_Map_Response,packet_type=0x2, opcode=0xb)
bind_layers(BTLEJack_Hdr, BTLEJack_Debug_Response,packet_type=0x2, opcode=0xe)
bind_layers(BTLEJack_Hdr, BTLEJack_Verbose_Response,packet_type=0x2, opcode=0xf)
bind_layers(BTLEJack_Hdr, BTLEJack_Access_Address_Notification, packet_type=0x4, notification_type=0x0)
bind_layers(BTLEJack_Hdr, BTLEJack_CRCInit_Notification, packet_type=0x4, notification_type=0x1)
bind_layers(BTLEJack_Hdr, BTLEJack_Channel_Map_Notification, packet_type=0x4, notification_type=0x2)
bind_layers(BTLEJack_Hdr, BTLEJack_Hop_Interval_Notification, packet_type=0x4, notification_type=0x3)
bind_layers(BTLEJack_Hdr, BTLEJack_Hop_Increment_Notification, packet_type=0x4, notification_type=0x4)
bind_layers(BTLEJack_Hdr, BTLEJack_Nordic_Tap_Packet_Notification, packet_type=0x4, notification_type=0x7)
bind_layers(BTLEJack_Hdr, BTLEJack_Hijack_Status_Notification, packet_type=0x4, notification_type=0x8)
bind_layers(BTLEJack_Hdr, BTLEJack_Connection_Lost_Notification, packet_type=0x4, notification_type=0x9)
bind_layers(BTLEJack_Hdr, BTLEJack_Connection_Request_Notification, packet_type=0x4, notification_type=0x6)
bind_layers(BTLEJack_Hdr, BTLEJack_Advertisement_Notification, packet_type=0x4, notification_type=0xa)
Image(models.Model)
models.ImageField(blank=True, null=False, default=DEFAULT_IMAGE)
models.CharField(max_length=100, blank=True)
models.CharField(max_length=1000, blank=True, null=True)
__str__(self)
str(self.id)
Profile(models.Model)
models.OneToOneField(User, on_delete=models.DO_NOTHING)
models.CharField(max_length=20)
models.ForeignKey(Image, related_name="profile_photo", on_delete=models.CASCADE, default=DEFAULT_PROFILE_IMG)
models.EmailField(max_length=30)
models.CharField(max_length=50)
models.IntegerField(choices=GENDER_CHOICES, default=GENDER_PRIVATE)
models.CharField(max_length=100, blank = True)
models.CharField(max_length=200, blank = True)
__str__(self)
Meeting(models.Model)
models.CharField(max_length=50)
models.ForeignKey(Profile, related_name="meeting_hosted", on_delete=models.DO_NOTHING)
models.DateTimeField('meeting date')
models.DateTimeField('posted date', auto_now_add=True)
models.ManyToManyField(Profile, through = 'Membership')
models.IntegerField()
models.DateTimeField('meeting deadline')
models.CharField(max_length=100, blank=True)
models.ForeignKey(Image, related_name="meeting_photo", on_delete=models.CASCADE, default=DEFAULT_MEETING_IMG)
models.CharField(max_length=500)
models.ManyToManyField('Tag', blank=True)
models.IntegerField(choices=STATUS_CHOICES)
models.URLField(max_length=100, blank=True)
models.DecimalField(max_digits=30, decimal_places=15, default=0, blank=True)
models.DecimalField(max_digits=30, decimal_places=15, default=0, blank=True)
tag_save(self, tag_string)
re.findall(r'\b(\w+)
Tag.objects.get_or_create(name=t)
self.tag_set.add(tag)
__str__(self)
distance_search(result, dist, lat, long)
from (latitude, longitude)
abs(float(meet.latitude)
abs(float(meet.longitude)
float(6371 * sqrt(delta_phi + delta_theta)
ret.append((result.get(pk=meet.id)
ret.sort(key = lambda item : item[1])
print(ret)
Tag(models.Model)
models.CharField(max_length=100, unique=True)
__str__(self)
Comment(models.Model)
models.DateTimeField('commented date', auto_now_add=True)
models.CharField(max_length=1000, default="Test Text")
models.ForeignKey(Comment, on_delete=models.CASCADE)
models.ForeignKey(Meeting, on_delete=models.CASCADE)
models.ForeignKey(Profile, on_delete=models.CASCADE)
__str__(self)
save(self, *args, **kwargs)
Notification(meeting=self.parent_meeting, profile=self.parent_meeting.host, notification = Notification.NOTIFICATION_NEW_COMMENT_FOR_HOST)
notification.save()
super()
save(*args, **kwargs)
Notification(models.Model)
models.ForeignKey(Profile,on_delete=models.CASCADE)
models.BooleanField(default=False)
models.ForeignKey(Meeting, on_delete=models.CASCADE, null=True)
models.IntegerField(choices=NOTIFICATION_CHOICES)
__str__(self)
str(self.profile)
Membership(models.Model)
models.ForeignKey(Profile, on_delete=models.CASCADE)
models.ForeignKey(Meeting, on_delete=models.CASCADE)
models.DateTimeField(auto_now_add=True)
models.IntegerField(choices=STATUS_CHOICES)
models.CharField(max_length = 500, null=True, blank=True)
__str__(self)
str(self.meeting.id)
str(self.profile.id)
save(self, *args, **kwargs)
if(self.pk==None)
Notification(meeting=self.meeting, profile=self.meeting.host, notification = Notification.NOTIFICATION_NEW_APPLY)
notification.save()